Dogs are predators, but can be surprisingly flexible in learning what is and isn't prey, especially if taught as pups. Dogs can get along with rabbits, chickens and cats, if trained from puppyhood to respect them. Cats tend to defend themselves. Small pups need to be supervised to ensure they don't plague the cat, and suffer nasty scratches. Pups can get the message pretty quickly with a cat that stands its ground, and cats are more likely to stand their ground if you are there to ensure the pup doesn't chase the cat. Likewise, pups need to be prevented from chasing rabbits, sheep and chickens, because once a chase starts, 'hunting mode' kicks in. You can keep the rabbit or chook safe with a barrier, and get the pup to focus on you, by playing games, so the presence of the chook or a rabbit becomes perfectly normal, no need to get excited.
Using a long line on walks gives you control and the dog some freedom. If he’s off-leash and you both spot a cat, or some sheep, a 'chsst' noise followed by a recall is a fast way of saying 'don't even think about it', you’re meant to be with me.
Teaching self control over potential prey takes longer with older dogs, though the principles are the same, supervision, never allowing the dog to give chase, and getting your dog to focus on you.