I had a dog who did this and it was amazing. It may be because dogs are warmer-blooded than humans or cats (I read where dogs' normal body temperature is around 102F). So they just dont' get cold as easily. Also they don't sweat: they lose heat by panting, so cold water simply doesn't cool their skin like it does ours.
My cat's normal temperature is also that high, so that argument doesn't hold water;) As a former dog-owner I think it's because dogs have a more developed sense of fun compared to cats and humans, not that they're stupid.
It is as a result of their instinct, developed through the animals history and evolution. Some large cats such as tigers need to swim often in their natural habitat, but most do not need to swim to survive.For dogs however, as wolves and wild dogs, swimming would have been more common. It is always possible for them to override their instinct, with knowledge from their life experiences. I know a dog that is frightened of water after he was thrown in once, and I have seen a cat on You Tube that likes showers because it wanted to copy its owners.