Could we have built on more of the burned-over mountainside? Maybe? I'm not sure SF is the right comparison though. Just the developed portion affected by the Palisades fire ranges from sea level to 450m elevation (over ~2.5mi straight-line distance); Temescal Peak is 650m. Most of developed peninsular SF is below 100m elevation. Its more like trying to densifiy Berkely or Pacifica or Carmel by building apartment buildings up their hills.
Doable? Probably. But why go to the trouble? Why take the fire and seismic risk of building dense housing on a mountainside when LA is spoiled for space in the basin and valley?