The sheep and dogs serve to advance the dictatorial ambitions of Napoleon in Animal Farm.
The dogs are originally Jessie’s puppies. Napoleon took them away at a very early age, with Squealer telling Jessie that they were to be given a special education. It turns out that their special education was training as a paramilitary force that would enforce Napoleon’s decisions. We first see them do this when Napoleon decides to get rid of Snowball:
At this there was a terrible baying outside, and nine enormous dogs wearing brass-studded collars came bounding into the barn. They dashed straight for Snowball, who only sprang from his place just in time to escape their snapping jaws.
The sheep’s function is nonviolent but very effective in keeping the other animals under control. As Napoleon exerts more and more control over the animals, he learns to use the sheep to drown out disagreement. When the animals try to debate, the sheep will break out into a lengthy chorus of “four legs good, two legs bad,” until the animals tire of trying to communicate. This chant is altered late in the story when the pigs begin walking on two legs to, “four legs good, two legs better.”