It is possible to build for a 7.8, at least so that the structure doesn't collapse (severe interior damage is inevitable). But many older high-rises in San Francisco were built to weaker standards or on soil subject to liquefaction and would be at serious risk.
https://sf.curbed.com/2018/6/18/17465696/highrises-san-franc...