I don't think I'd punish the dog, I've found positive reinforcement training to be more effective. I have 3 dogs, all different breeds, and they're all chicken/pig/goat/cat/rabbit/ect "safe". The route I took was to always set them up for success. If they don't have the opportunity to do give into their bad behaviors, they don't have the opportunity to make them a habit. Kikopup on YouTube has some really great videos about positive reinforcement training, they helped me a lot when we got our last puppy. It had been quite sometime since I'd had a small puppy, so I did some refresher training for myself to prepare us both for success.
What I did to teach them to leave our small critters alone was to leash walk them all the time outside. We would walk up as close as we could to said critter without the dog reacting (if they do react, you've gone too close, take them further out until they don't react). One you've found that sweet spot, praise them for not focusing on the critter and do a short training session at that spot (sit, stay, look, leave it ect). Once they've mastered that spot, move closer and repeat. You'll do that until you're right next to them and the dog only focuses on you. Once that step is mastered, you can either set them up on a longer tether or go off leash. The point is, the dog should look to you for direction, not just decide what they want to do. Obviously, you'll want to do some basic training before you start this portion, and I cannot emphasis the importance of the leave it and recall command enough. If things get out of hand, you'll at least be able to tell the dog to drop or leave whatever its got and come back to you (not a big deal while on leash, but can be an issue when you start the off leash/long tether part). It's time consuming, but your dog is a family member that will be with you for years to come. Putting in the initial time investment is a pain in the beginning, but its very rewarding when you end up with a dog that's safe with other animals and will actually listen to you (and some of those commands, like drop it/leave it and recall could possibly safe your dogs life one day).
All that being said, would I turn my dog out completely unsupervised with my chickens? The answer is no. They're good dogs, and they listen well, but they're still dogs and things happen. Can I pop back inside the house to use the restroom or grab a drink and them be out with them, sure, and I do. But I do that realizing that its a risk (and that I'm potentially setting them up to fail). It hasn't happened yet, and I hope it never does, but all I can do is try to help my dogs succeed. And that's all you can do as well. Good luck.