(the omission of ) articles in front of dinner/ class?

There is no convention for knowing which nouns are able to exclude an article. There are several additional categories that can be article-free, but again it is just a helpful generalization. Almost all of them are perfectly capable of having a definite or indefinite article depending on the sentence.

Locations:

At camp, we built a fire. The camp was set on fire! I want to go to a nicer camp next year.

Meals:

We had roast for dinner. Unfortunately, the roast burned. It always burns whenever I cook a roast.

Transportation:

You'll get there faster by car than train. You can take the car. I prefer the comforts of a train.

Uncountables (the indefinite form is generally presented without article):

I like to drink water with my meals. Please pass the water.

This is by no means a comprehensive list. Some nouns are found mostly without articles. These are the ones you mentioned in your question: nationalities, sports, subjects, but also seasons and holidays.

Seasons:

Leaves typically fall off trees during autumn.

Holidays:

I prefer not to work on Christmas.

Language/Nationality:

Unfortunately, like so many things in English, the usage does not follow a very strict set of rules.