Volcanoes can occur at other places than plate margins. Hot spots where magma is close to the surface can cause volcanoes. This is how many oceanic islands are formed and places like Yellowstone are formed.
Most earthquakes that do not form at plate margins are man-made as due to fracking for oil where water, sand, and chemicals are used to force open the bedrock to obtain oil.