'Of' makes it refer to a group that you specify. Suppose there's a bunch of eggs in front of you.
If you say 'I used a dozen eggs', you could be talking about any twelve eggs.
If you say 'I used a dozen of these eggs', then you're saying that you used twelve of the eggs that are in front of you.
'A dozen of eggs' is not correct, because you need to indicate what group the eggs are part of. 'Twelve of the eggs', 'a dozen of Fred's eggs'.