Yes. Earthquakes do occasionally occur in the Boston area.
Most earthquakes occur along faults at or near the boundaries between tectonic plates. The earth's outer layer consists of numerous tectonic plates that slowly move across the surface of the earth.
Green dots show the distribution of earthquakes worldwide, outlining the boundaries between tectonic plates. (Red triangles show volcanoes) Source: Unavco
Sometimes tectonic plates move past each other smoothly, but sometimes, friction at their contacts causes them to get stuck. An earthquake occurs when rocks that are stuck, suddenly slip past one another, and release energy that causes ground shaking. This energy can be recorded by a seismometer.
Animation showing rocks slowly moving on either side of a fault, then "snapping" during an earthquake. Source: USGS via Giphy
The process is somewhat similar to a large slab of snow suddenly sliding off your roof in the winter (and the sound it makes is analogous to the energy released).
Snow sliding off roof in a mini earthquake. Source: Giphy
But Boston is not located along an active tectonic plate boundary.
Instead, it is thought that earthquakes in the Boston Area occur along zones of weakness in earth's crust, likely related to the presence of ancient faults that may have been active millions of years ago during the formation of the Appalachian Mountains. These earthquakes may help the plate adjust in response to stresses caused by their motion across the earth.
The exact causes of earthquakes in New England, and the locations of the faults that can produce earthquakes is a subject of ongoing research. Check out some recent work by scientists at Boston University, MIT, and Boston College about earthquakes in New England:
You can learn more about Earthquakes in New England here: