They could both be correct.
ON time means not late and IN time means not TOO late.
If the dinner was scheduled for a specific time, say 7 p.m., you would be ON time if you were there at 7 p.m.
If dinner was served between 6 p.m. and 8 p.m., you would be IN time if you got there before 8 p.m. But you couldn't be ON time for dinner in this situation as there is no specified point of time.
I didn't arrive at the meeting ON time but I was IN time to see the final presentation. = I was late for the [start of the] meeting but I wasn't TOO late to see the final presentation.
I was ON time for my interview. - there was an appointed time for this
I dropped a glass but I was able to catch it IN time [before it hit the floor]. - there was no appointed time for this
To decide which one to use, you can ask the questions:
Was I late? - ON time
Was I too late? - IN time