"earth" here in earthquake refers to the ground, dirt, land, not the planet Earth. Therefore, if a quake actually happened on Mars, it would still be called an earthquake