You need to put the dog in a run it cannot get out of. Or the ducks in a run the dog cannot get into and you need to accept that your dog will go after your ducks ANY TIME it is given half an opportunity to do so...
You can also assume, that for your dog, the reward it gets from chasing and grabbing the ducks, is so great, that it is, in the dogs eyes, worth any punishment or other consequences that come from this behaviour, or that simply the excitement of the hunt, is so great that any thoughts of what you want the dog to do, or punishment or anything else at all, are just completely forgotten in the thrill of the duck hunt!
It’s not the dogs fault, they are an animal which would die in the wild if they did not hunt and kill, so it’s totally normal for a dog to have an instinctual drive to chase, hunt, grab, kill and eat, and you are working against this whenever you try to get a dog to stop chasing or harming prey animals such as ducks. Once the dog has had a taste of this as in it’s actually been successful in grabbing a duck (even if it never killed or ate it) your job of stopping it doing this is not only difficult, but possibly impossible. It might behave around you, but you must accept that any time you are not present, even if just for a moment, your dog is going to go after those ducks....
So you need to ensure that at all times it is impossible for the dog to get to the ducks, by either putting the dog in a run it cannot get out of, if the ducks are to free range, or putting the ducks in a suitable dog proof run and not allowing them to free range...
Or switching between the two, ie keeping the ducks in a dog proof area and only allowing free range once the dog is secured in a dog proof run, and not letting the dog out till all ducks are back in their dog proof area.
If the above options are not acceptable to you. You need to rehome either the dog or the ducks, for their own sakes.