I agree with the other who say "training". Of course, some breeds are more prone to chasing. I probably wouldn't recommend a terrier. I have two border collies and a golden retriever. One of the BCs is afraid of the chickens, one is fascinated and the golden was very interested in chasing them, but a firm "NO" or "LEAVE IT!" when they tried anything worked well. Of course, my dogs already have a lot of training on them (dog training is my other main hobby), BUT, I'm still not sure I would leave my dogs alone with my chickens.
Beth
Beth