It depends on the individual dog I think. I have one, Diva, that is an excellent swimmer - better than some noted water dogs that I have seen! She not only swims but dives/jumps off a bank into the river with all fours tucked up underneath her (like an aeroplane wheels retracting) and she is magic to watch. Diva has also now taken to ducking her head under the water completely if she spies something that she thinks might be of interest - like a coloured stone. Monty on the other hand doesn't mind the water and will stand in it up to his chest but there is not way those long legs of his will leave the safety of the river bed beneath him.
Diva was around water from a young age and also socialised with other dogs at the beach alot. I think she learnt to swim by accident really - just went out too far one day and had to doggy paddle back to shore!