Origin of firewall
Firewall reaches English through Dutch and German. Firewall today means “A fireproof barrier used to prevent the spread of fire between or through buildings, structures, electrical…”.
Etymology of firewall
From fire + wall. Compare West Frisian brânmuorre, Dutch brandmuur, German Brandmauer, Feuermauer, Swedish brandvägg, brandmur, Icelandic eldvegg. The verb sense for using maximum power or acceleration comes from the engine's firewall being the limit of forward movement of the throttle controls on many simpler vehicles; thus, to get the maximum engine output, one would push the throttle levers or pedal all the way to the firewall. The politics sense is a calque of German Brandmauer.
Etymology text from Wiktionary (CC BY-SA 4.0). Asterisked forms are reconstructed, not attested.