Yes, but if the gasoline engine were invented today, it would never be allowed in consumer cars due to safety concerns.

I think the powers that be know this, and are already cutting lithium-ion powered cars some slack. They may not be perfectly safe, but the alternative is worse.

The only thing that makes lithium-ion batteries worse than gasoline, is that you can’t put a lithium-ion fire out since it has its own oxidizer.