Why can all animals swim in water without learning to swim but humans cannot?
While I am not sure I buy your assertion that all mammals know how to swim, I would say that humans are at least as good as dogs when swimming. If you drop a human in water we will instinctively flap around and try too keep our head out of the water in about as elegant a way as a dog. The main problem for humans is panicking. Someone who does not know how to swim is likely to panic and not manage to keep their head out of the water. Remember that humans float in water, if you keep calm you should be able to keep your head above the water line easily enough.
Dogs can't swim as such, they simply do the same motions in the water as they do on land. There is no different action happening, they don't instinctively do a breast stroke.
In addition, human infants actually have a couple of instincts that make them &quot;swim&quot; (source):

The Diving Reflex
The diving reflex, or bradycardic response, means that infants whose heads are submerged in water will naturally hold their breath. Their heart rate will also slow down while they are underwater. This reflex disappears after about six months of age.
The Swimming Reflex
Newborns placed stomach-side down in water will move their arms and
legs in a repetitive &quot;swimming&quot; motion. This is known as the swimming
reflex. This reflex, too, begins to fade at about the six-month mark.

That is no better and no worse than any other non-aquatic mammal can do. Try dropping a cat in water* and telling me she is a graceful swimmer :).
* Don't, that's not nice.