is the grammar correct in the question?
did you get vaccinated?
I know we are not supposed to use past tense for verb with did but I can't understand this one.
You are right that a base verb should follow "did"... and it does. You have the verb 'get'.
It's quite common to use 'get' + a verb in the past participle form, even if talking about a future event, for example "let's get started". Equally, you could ask "are you going to get vaccinated?
It would of course be entirely incorrect if you asked "did you got....".