Because elma is in the nominative, the sentence isn't talking about a specific apple, but about the fact that generally speaking, ducks eat apples.
The translation for "an apple", if I'm not mistaken, would be "Ördekler bir elma yer", to show that no specific apple, but only one, is meant instead.
Those are different. Chocolate as a substance is not countable. Apples are. We use normally use a plural on chocolate only when speaking of a box of chocolates and in that case we would say "the ducks eat chocolates" just as we say "the ducks eat apples".
I'm Canadian, a native English speaker and sometime teacher of English and in my more than 70 years I have NEVER come across a situation in which "The ducks eat apple" sounds natural. I would have counted it as an error had it turned up in a student's composition.
It may be acceptable in some regional dialects, but I suspect even there it would be rare. I would not expect a language learning program to include rare or local uses over standard everyday uses.
Native English speaker, Brit/Canadian, former TEFLer too. It's fine. As another user explained, it becomes uncountable when you're referring to it as a substance rather than individual fruits. Eg, imagine if a baby was eating pureed apple as baby food. She's eating apple. Conversely, uncount nouns can become count when you're talking about varieties. Eg "there were many different breads - rye, sourdough, spelt."