Eggs are sold by the dozen.

Literal

Egg [topic-は] 1-dozen unit [by-で] are-sold.

単位 ('unit') is a key vocab for measurement and organization. ~単位で is a fixed pattern meaning 'by the [unit] / in units of [X].' The で here marks the means/unit of the action, different from the location-で. ダース is a loanword unit, not a native Japanese count.