The table does move in and out, so it is likely that what you felt was real. Perhaps, when you opened your eyes it had already stopped. They take different "cuts" depending on what they are looking for, so, sometimes the table is moving and sometimes it stays stationary as they optimize the settings to get the best pictures. MRI's are very unnerving for some people, especially those who are claustrophobic. Occasionally, we have to provide anesthesia for adults that can't tolerate it. Almost all young kids get anesthesia for MRI's because of their lack of ability to lie still or cooperate.
The whole thing likely just messed with your optics like when you are next to a car at a red light and it is moving forward and makes you feel like you are rolling backwards. MRI, in and of itself, does not cause brain dysfunction or hallucinations, although the overall experience can make people very uncomfortable due to the tight spaces, the loud noises, and the movements.
I hope that helps.