Unreinforced masonry structures, tilt-up concrete buildings, and the like are far more dangerous. California has a lot of legacy tilt-up concrete structures in industrial and commercial zones.
Residences are probably more vulnerable to the resultant gas leak fires than the quake itself.
It's masonry buildings that are the most dangerous.
Either way, you should not be trying to exit a building during an earthquake because the greatest risk is debris falling on you, not the building collapsing on you.
In fact, framed houses are so safe that the current advice is that if you are in bed when an earthquake occurs, you should stay in bed. You are more likely to get hurt trying to get out of bed and find cover.
Also heard stories in the SF financial district of large glass windows popping out and falling into the street below.
Best time to sort out what to do is before the earthquake.
The reason to stay indoors is if you're in a city or next to buildings where glass and shrapnel could fall on you. If you have open space outside, then that is a much better place to be.
Generally, standing in an interior doorway is a far safer move.
You don't need to be in field in Kansas to be safe outside. If you're in the suburbs you have lawns, parking lots, or streets and there aren't windows above you. Obviously if you're in downtown LA or SF don't go outside. But there's a lot of people that don't live in, or aren't going to be in, an area with multi-story buildings completely surrounding them. You can easily get far enough away from a couple story building (parking lot) and be safe. That is much safer than inside said building.
Here's the rule of thumb "If something can fall on you outside, go to a door frame or braced structure." But I'll reiterate, it depends on your initial location.
The most useful place to be in a major earthquake is anywhere where things are not going to swing into or fall onto you. Such as underneath a desk (assuming it's not a cheap construction that will buckle under any significant weight).