The Earth's surface is made up of two types of crust:
Earthquakes are found along all types of plate boundaries (or margins) as shown on this map.
Volcanoes are also mainly formed at plate boundaries. There are some important exceptions. for example the Hawaiian Islands, which are entirely volcanic in origin, formed in the middle of the Pacific Ocean, more than 3,200km from the nearest plate boundary.
This is explained by the 'hotspot' theory, that there are fixed spots in the mantle where magma rises to the surface. As the crust moves over these fixed spots, volcanoes are created, eventually forming a chain of volcanoes.