This topic comes up fairly regularly.
Summary of points I've read in previous discussions:
--most puppies will try to play with chickens, and end up killing them.
--most adult dogs will also try to play with chickens, and kill them, unless they have been trained otherwise.
--many breeds of dogs CAN be trained to not kill chickens, especially if you start when the dog is young. The list of can-be-trained includes almost any breed that is known for being trainable and working well with people (including retrievers and herding breeds), as well as the traditional guarding breeds. Breeds like huskies, greyhounds, and some terriers are LEAST likely to work well, because they traditionally have a strong prey drive and not very trainable.
--having any dog that just lives on your property, outside the chicken pen, will deter some predators. (They look for easier prey.)
--having a big dog, or more than one big dog, that act protective of their territory will deter more predators.
--some predators will kill your dog, depending on which predator, whether it travels in a pack, which size & kind of dog you have, and other variable.
--having the dog live outside the chicken pen will mostly avoid the risk of your own dog killing the chickens.
--for that kind of predator pressure, many people recommend an electric fence outside the chicken pen, and they often recommend putting some kind of bait (like bacon or hot dog) on the fence. This causes a predator to sniff the bait, get shocked, and avoid the electric fence in future. An animal with a thick coat (like a bear) won't notice or care if it just brushes against the electric wire, but the nose is sensitive enough for the bear to notice. And once it's learned that the wire "bites," it will be more inclined to avoid it in future.