"All the ducks" is correct grammar. "All" is a determiner indicating every member of a group, and "the" is a definite article specifying a particular group.
"Of ducks" is incorrect because "of" is a preposition that needs a determiner, such as "of the ducks" or "of those ducks."