Sheep can swim, but only in dire circumstances.
The ability is basically instinctive, and a life-saving device.
They don’t go swimming every day, but in case of flooding, or falling into a river, in essence they know how to swim.
Sheep have never been known as big swimmers, and most of the habitat where they evolved does not now have a lot of water resources.
However, like many animals, they float.
Then, in struggling to keep the head above water and to keep breathing, the method they use is basically fast walking, which constitutes a kind of dog paddle.
A number of mammals that do not normally swim, like a migrating caribou or a wildebeest in Africa, know they want to cross a river, get in and dog-paddle across.
American bison even swam across parts of the Mississippi.
Other large mammals can swim too. Cattle can swim when herded across a river, as Western movie fans know.
Deer can swim as well. The moose, the largest deer in the world, actually feeds in water and is a very good swimmer.