You can not only switch a second stage underwater (if the nut is not tight so you can spin it off - turn OFF the post first!) you can even switch a FIRST underwater (again, turn OFF the post first!)

However, doing either floods the first stage. The effect of doing this depends on the reg. Some take it VERY badly, some not so badly, but all should be torn down immediately if you do this and gone through to get the water out of where it does not belong - whether its fresh or not.

I consider such a stunt an absolute last gasp effort to avoid dying. Regs aren't that expensive and there is a very real risk (especially with a diaphram reg) that it will take such a stunt VERY badly.