"Did you have dinner last night?" would be a better way to phrase that.
I could have eaten at any time last night, so if you want to ask about dinner specifically, you should include that in the question.
The past perfect tense is also not really appropriate here. Check out this website to review when to use it: http://www.englishpage.com/verbpage/pastperfect.html
Hope that helps.