They can’t literally swim, the act thereof I mean. But they can and will survive under water. Zombies don’t need to breathe, and may wander at the bottom of a body of water for quite a while. They will also attempt to attack a human, should they spot one in the water. It really makes no difference to them, and probbaly they aren’t even close to realizing that the water greatly impedes their motor functions.
Hell in the movie Zombi/Flesh Eaters one of them attacks a shark
I was of the mind that dead bodies, undead or not, floated though…realistically, I don’t think they would walk at the bottom of anything, unless it’s a relatively calm body of water. Even if their flesh absorbs a lot of water, they would still float, as dead bodies tend to do for days, if not weeks.
Either way though, weather they float or not does not matter; you’re not safe from zombies on or in water.