There are several different types of volcanic earthquakes. One of these, the volcano-tectonic earthquake, is identical to a tectonic earthquake. Both are generated by sudden slip along pre-existing faults that are subject to stress: either stress generated by the movement of magma or stress generated by the movement of tectonic plates. Volcanic earthquakes are usually much smaller in magnitude than tectonic earthquakes, but the only real distinction is that tectonic earthquakes are not located within a volcanic system.
The other types of volcanic earthquakes, including hybrid and long-period events, rockfalls and tremor are only found at volcanoes.