Any energy storage medium that holds a good amount of energy and has a methods to release it in a fairly short time frame (either through a failure mode or through intended use) deserves some real thought. Which is basically what you were saying...
- Natural Gas is brought in through VERY small pipes, and is never kept anywhere, it's just used immediately.
- Jerry cans are found regularly but are also sealed up as much as possible while still remaining usable.
- Vehicles have sealed fuel systems, and are designed to not allow the fuel to combust all at once if at all possible.
In fact, now that I'm thinking about it, pretty much the only time you hear about homes exploding/bursting into flame/etc. is when one or more of these systems is compromised.
Medical oxygen plus ignition sources (especially cigarettes) seems to be another (for “bursting into flames” more than “exploding”.)
That said, a firewall is not a fire proof wall, it's a wall designed to burn slower to prevent the fire spreading between those areas too quickly. Its purpose is to retard the fire u til it can be put out or so you have enough time to escape with your life. I suspect with failed batteries the latter is more likely your best chance.
The logical conclusion of this is someone mentioning ICE vehicles and gas tanks, so allow me to be that person. If you park your gar in the garage and it's an ICE vehicle, you're parking quite a lot of latent energy in a fairly volatile form in your house.
If you wouldn't feel comfortable rigging a bunch of old gas cans in tandem to a little engine your scrounged as a DIY generator and putting it in your garage, maybe you shouldn't rig a bunch of batteries up in a similar arrangement.
For that matter, with that perspective, how far away for your cinderblock outhouse is far enough?