Keep them clean.
How old are the chickens that are doing the pecking?
I have both ducks and chickens, but I haven't raised them together - it was either a batch of ducks or a batch of chicks. The adult ducks don't like the little chicklets. The adult chickens don't like the little ducklets. I integrate by having a pen for the littles so everybody can see each other, but nobody can pester the new babies. Then get free range time together and the bigs are allowed to get close, but that is very closely supervised and if anybody tries something, they get stopped in their tracks.
With my last batch of chicks, one of the new babies walked up to an adult hen. She seemed to like them and had no issues with them around her. Well, he reached up and poked her. So she poked him back and removed some feathers. I let that happen. He never did it again. But I let that happen because he started it - wasn't like she just walked up and beamed him in the head.
But if your chickens are older/bigger than the ducklings, you need to keep them separated for a while and any interaction between them should be with you there if there isn't a fence between them.