Not all dogs can or will swim. Sometimes it's due to their body structure (bulldog) and sometimes they just don't understand how to naturally. My Murray, being half poodle and half golden retriever, is expected to take to swimming naturally, be he doesn't. He's not afraid of water, but he doesn't know how to swim as dogs generally do. Therefore we practice with him, and practice water safety.
We have dog life jackets for both of our dogs and regularly use them around open water. It allows us to practice swimming safely with Murray and it gives our senior Piper some added buoyancy so when he starts to get tired out swimming, he's still safe.
Dogs that swim in pools, or might fall or jump into a pool, will often panic in attempting to get out and must be well trained where the exit steps are. If they do not know how to get out, they are likely to try to get to the pool edge, but quickly find that's not going to work. This can quickly lead to exhaustion and a very serious situation. Solar pool covers can also pose a danger if a dog were to run our on top of it and get stuck. It's also important to keep your dog from drinking chlorinated and treated pool water.
Dogs don't know how far away they are swimming when in a body of water like a lake, and also are not aware of any current helping to carry them away. If they are off trying to retrieve something or swim toward something, they can often get farther away from their safe starting place (shore, dock or boat) than expected. There are a few concerns here...exhaustion comes into play and safely getting your pup back to you, as well as making sure your dog does not get into the path of a boat or jet-ski, get hung up on a rock or limb underwater or run into any fishing line. All of these would pose quite a danger to a swimming dog. Keep a close eye on them. A good sign to indicate a dog tiring while swimming is their tail dragging low behind them in the water instead of straight out helping to direct them like a rudder. Also again, don't allow your pup to drink lake, pond or ocean water.
It's important to have your pet well trained if he's going to be around open water of any kind, and it's equally important for you to be prepared for any accidents that could occur with your dog first aid kit and knowledge of dog CPR.