If you're taking your dog swimming either at the beach, or they have access to a pool they should be supervised as children are.
Swimming doesn't come naturally to all dogs and those with longer backs find it harder than others.
In a pool they should be shown the exit or they can exhaust themselves trying to climb out the deep end. You can mark it with flags or tape wound around poles. At the beach some dogs go in over their heads (literally) and can't find their way to shore, floundering in the waves.
Drowning is very possible and access to pools should be restricted to times when people are around and a shallow clam shell pool offered instead