In 50 BC the Library of Alexandria burned. In 64, Rome went up in flames, as did Amsterdam in 1421. In 1666, most of London turned to ashes, including over 13,000 homes. In an 1845 theater fire in China, 1,670 died. In 1911, the Triangle Shirtwaist Factory fire killed 148 workers, including 62 women who, with no way out, jumped from the ninth floor in front of thousands of horrified onlookers gathered to watch the fire.
Mankind's bargain with fire has always come at a heavy price, but today, thanks to fire codes and enforcement, as well as professional fire fighters, its impact has been dramatically lessened. When I hear people complain about the burden of getting permits for construction and putting up with fire department inspections, I ask myself how they would feel watching their houses or businesses engulfed in flames.
The codes aren't particularly burdensome, just common sense (which is, in fact, rather uncommon). Have fire-fighting materials: sprinklers, alarms, extinguishers. When you build, don't put flammable stuff next to hot stuff. Don't use materials that put out deadly fumes when ignited. Don't wire in a way that would allow electricity to overheat circuits or short out. Keep highly flammable materials in secure containers. Make sure you can exit the building in multiple ways, and rehearse those exits.