Typically, chickens and ducks can live together without any issues. Although both birds can be somewhat territorial they generally get on well together.
There can be various reasons why your chickens attack your ducks. These can include because the ducks are new to the flock, because the chickens have young, or because there is not enough food to go around and chickens can be more food aggressive than ducks.
The main reasons your chickens are attacking your ducks include;
Overcrowding
Both chickens and ducks can become aggressive when they are kept in a space that is too small.
If there is not enough room for each of your birds to have a little bit of their own space, either because the enclosure is too small or because there are too many birds for the space (although these are technically the same thing), their tempers can become frayed and fighting may break out.
It is usually the case that a chicken will attack a duck, but it can be the other way around. In my time I have kept ducks that were so aggressive they would chase my dogs away!
Solution:
If your chickens are attacking your ducks due to a lack of space, you essentially have three opinions.
Firstly, you could look to reduce the number of birds in your flock. This can be easier said than done, but with a bit of effort, you can usually find someone locally who is prepared to offer a couple of birds a new home.
Secondly, you could look to increase the size of the enclosure. Even if the coop remains the same size, the space the birds have to roam around in increases, which should allow the birds to get away from one another more often, reducing the number of times tempers flare.
The final, and the probably least desirable option is to divide the enclosure in two, putting the chickens on one side and the ducks on the other. In reality, this solution may actually make things worse, with the chickens attacking one another rather than the ducks.

Ducks are Newcomers
Chickens are flock birds that have a set pecking order. The phrase pecking order comes from the way chickens decide where they sit in relation to the other members of the flock by pecking one another.
If you introduce ducks to your chicken flock, as far as the chickens are concerned, the ducks are just another member of the flock. As such, their place in the pecking order needs to be established. They do this by pecking one another.
Sorting the pecking order is normally a fairly brief affair with a few pecks from each bird, to decide where they sit in relation to the rest of the flock. However, sometimes a bit of mild pecking can turn into bullying or an outright attack.
Solution:
If your chickens attack the ducks when trying to sort the pecking order, the best thing to do is to take the ducks out of the situation for a day or so, then, before returning them, have a bit of a rearrange in the chicken enclosure. By moving the coop (whilst the chickens are still inside) as well as any features, furniture, or obstacles including drinkers and feeders, you can sometimes partially reset the pecking order, meaning everyone is so preoccupied working out their new positions before they know it, the ducks are just part of the flock.
I have used the technique to great success a couple of times.
Lack of food or feeders

Both chickens and ducks are fairly enthusiastic feeders. Both can also be food aggressive when there is not enough food or enough feeders for all the birds to feed.
In my experience, having too few feeders in an enclosure can cause chickens to attack not only ducks but also other members of the flock. Sometimes chickens will use food and feeders as a way to show their dominance over the other birds.
In my own enclosures, I always have a minimum of two feeders, and sometimes three or even four feeders spread around the enclosure. It is easy for a single chicken to dominate one feeder and prevent either all the other birds or just one individual bird from feeding. It is however much harder to dominate several feeders, especially when they are spread out.
Solution:
If you think your chickens might be attacking your ducks to stop the ducks from feeding, or because there is not enough food to go around, add one or two more feeders to the enclosure. If your ducks have a choice of which feeder to go to, it is unlikely the chickens will prevent them from going to all the feeders.
Overheating
When the weather is warm, all our tempers become a little frayed, and chickens are no exception. I notice in many of my flocks that pecking increases during the summer months when the birds are warmer.
Chickens are hardy and can live in a wide variety of climates, but they are essentially descended from Jungle Fowl, and the jungle typically has lots of shade keeping the birds out of the direct sunlight.
Solution:
During the summer months, when the sun is beating down, try and provide as much shade as possible for your birds. If their enclosure has a wire mesh roof, try tying sheets or tarpaulins to the roof, creating shaded areas.
As a long-term plan, planting trees and bushes around the perimeter of the enclosure can increase the available shade, especially in future years when the trees and bushes have grown.
If your setup allows for it, try adding electric fans blowing across the enclosure. Ideally, the fans should be located outside the fencing, but blowing in, so the chickens can’t hurt themselves on the fans. I have used fans to great effect during really hot years.
Stress
It is funny to think of chickens as being stressed. What do chickens have to be stressed about? In reality, stress can be a major problem for chickens. It can cause them to stop laying eggs, start plucking their own feathers out or even become aggressive to other birds.
There are many causes of stress in chickens. Predators prowling around the enclosure, either during the day or at night can be incredibly stressful for your chickens, as can mites. A bad infestation of mites can stop your chickens from sleeping at night, causing them to become incredibly stressed.
Solution:
Working out the causes of the stress can be tricky. Start by looking at the enclosure and coop. Are there any signs predators may be entering the coop or the run? Are there any indications mites might be present, either in the coop or on the chickens themselves. Is there anything to indicate external factors like loud noises or a nearby bonfire pile are causing the chickens stress?
Once you manage to find the cause of the stress, rectify it as quickly as possible, and there is a good chance the birds will stop attacking one another.
In Conclusion
Chickens and ducks can live in harmony together. I have had flocks with both birds living side by side many times in the past. If your chickens are attacking your ducks, work through the list above and try to work out what might be causing the problem. Work through the solutions, and hopefully, your flock will settle down for you.