Depending on how raised your garden is, and how many ducks you have, they might not even get into the garden, let alone do damage. I find that my 14 to 20 ducks who roam on 2 acres, do not--as long as they are fed and have room to roam--get into my raised beds. The beds have to be raised more than a foot, though.
But, it's really easy to fence them out of a garden. They usually won't go over a 1 foot tall fence, as long as it's pretty ridged. A 2 foot fence would certainly keep them out.
Some ducks are more adventurous than others. I've had some that will climb up into my garden bed and squsih down a floppy 1 foot chickenwire fence to eat the bugs in my garden. But, that's just a few of my ducks. Two thirds of mine don't do that.
But, even when they get into the bed, they don't do much damage--as long as they aren't boarded or hungry--to my established plants. They tend to eat the bugs and slugs and spiders first. They will eat seeds--especially squash and beans and pea seeds. Mine will not eat kale, radish, or other brassicas. They also don't eat my alliums, though they sometimes bend the stalks down. They'll eat all berries, but don't care for the tough leaves. When I was unknowingly underfeeding mine, they ate my potato plants. Now they do not. They like sorrel, beat greens, and other tender leaves. They don't eat rhubarb. Most of the "damage" to my plants is from them pooping on or squishing the plants. Fir a while, we had a chicken. She would sometimes get into my garden and did more damage in 30 minutes than 15 ducks would do in three hours.