Your spelling is off in the title, Vic. Dessert ≠ desert .
In the example, it seems the speaker knows they're both aware of the main course (all dinners have them), but dessert is a new idea for the conversation, being introduced by the speaker. Before this was uttered, it wasn't common knowledge between them that they would be having a dessert. Obviously this doesn't just apply to foods; it's just an article distinction.
Crossed with Florentia. I agree with her that "the" would be fine, too.
For a meal eaten at home, it's not uncommon to have more than one dessert (either different people have different desserts or some people have two desserts), but it is uncommon to have more than one main course.
We're having tuna casserole. For dessert, there's cake, cookies, or fruit.
"Main" pretty much defines it as being singular.