It only becomes dangerous if you re-enter your vehicle while fueling. That basically primes you for a static shock. I live in a state that has people who can pump your gas for you. I was one of those people once, and they made me watch a few videos detailing several has station fires and explosions and what the causes were. It’s almost always someone who gets back in their vehicle while pumping.
If the battery in my GMT400 Suburban dies, it’ll lock all the doors the second you give it power. I learned this the hard way, but fortunately I have a janky window I was able to force down enough to reach in. Could have been a lot worse.