Sometimes, sometimes not.
Not much of a problem when you are on good soil in well built buildings.
Mexico City is built to 'Mexican Casual' standards on what amounts to a bowl of jelly.
The Mexico City quake in the 50s was over 7 and other than a very few 150 year old plus 2or3 story brick buildings and the new American high rise hotel there was very little damage.