Earthquakes damage buildings in many different ways, some obvious and many not so obvious. As an example, cracks in walls and ceilings can seem outwardly to be minor, but there can be hidden damage that takes a trained eye and sometimes destructive testing to ascertain the full extent of the damage.
Wood frame structures are very flexible and can move quite a bit without suffering much damage, although walls shifted out of their original position can represent a change in the structure's integrity. A shift of a couple of degrees is usually minor, however the structure has been compromised to some degree and will not perform as well in the next earthquake. A shift of more than about 5 degrees usually will require further investigation by an engineer to determine the extent of the damage and repair.
Heavy materials such as brick and stone tend to suffer more serious damage than lightweight structures because they are much less tolerant to movement. A chimney or a brick wall can appear to remain stable after an earthquake and yet have suffered damage that severely compromises its structural integrity, creating a potential hazard in the next quake. It takes an expert with trained eyes and special equipment to determine the safety of chimneys and masonry structures after an earthquake.
In summary, earthquake shaking can cause damage to a chimney that is hidden and potentially very dangerous. Have chimneys professionally inspected after a seismic event for your safety and the safety of others.