Some electric motors can run underwater if they are made for being submersed in water.
However normal or regular electric motors that are not completely sealed cannot run underwater or they would short out and seize up.
An example of an electric motor that can run underwater is a submersible well pump which has a sealed electric motor on it that can safely be submersed in water.
The electric motor is completely sealed off to prevent water from getting inside the motor itself and the water also helps keep the motor cool from the outside.
Sump pumps are another electric motor that can also run underwater or even sewage pumps that are made to be submersed in sewage to pump the sewage.
These electric motors are completely sealed off to prevent water intrusion into the motor and so they are okay to run underwater.
If you try submersing a regular electric motor underwater it will short out and will cease to work.
And although not in water but gasoline an in take submersible fuel pump also works when submerged in gasoline as the motor itself is sealed off to prevent gasoline from getting into the motor.
And even fish tank pumps are sealed and can be submersed in a fish tanks water.