Normally, there are precautions put into place to ensure something like this doesn’t happen — including magnetically detachable nozzles.
It’s a good thing too, because without those precautions something as disastrous as this can happen. In the above video, a forgetful drive drives off with the gas nozzle still stuck in his car, sparking a chain reaction that ends in a spectacular fireball.
Even if you’re going to leave your gas cap open, never be so forgetful as to let this happen, for God’s sake. Watch the GIF above if you need any further convincing.