If the windows can be opened. If the water is over the roof, the windows are being pressed so hard against the inner seals that the electric motor will stall.
If you're not panicking then the headrests in most cars can be removed and the metal spikes on them are specifically designed to allow you to smash a side window from inside, even when the inside is completely full of water.
or just open the windows