You can reduce the chances by avoiding parts of the world known to be vulnerable to earthquakes.
Generally edges and corners of rooms are safer (as I understand it), because the ceiling says attached at one end, which forms a protective tent space, and the other end swings down, missing the other wall. You could try to arrange to sleep against a wall.
Keep your mobile phone close at night (and during the day). Maybe keep a survival kit (eg, bottle of water and a crowbar) under the bed where you sleep. Have another crowbar elsewhere in the house so neighbors have something to dig you out with. I imagine a building which does not kill you outright will probably be survivable. You can usually expect rescue within a few days.
If you are worried about the phobia rather than the event, you can seek treatment. I expect a course could be devised involving a succession of smaller enclosed spaces. Perhaps a gentle "introduction to potholing" course would do.
_________________________
Quality is addictive.