is correct to say:
I had a dinner or
I had dinner
Hello Anita, welcome to Using English!
In most contexts, you would say "I had dinner", e.g.
1. I had dinner at 9 last night, and then went straight to bed.
2. I had dinner with Anita this evening.
Cf. "I had breakfast".
However, sometimes you say "a dinner"; if you want to qualify "dinner", for instance:
3. I had a roast dinner this evening.
Or if the dinner was a special:
4. We had a dinner for 20 in Anita's honour.
But these are special usages; in ordinary contexts, it would be "I had dinner".
All the best,
Not a professional ESL teacher.