During the follow-up discussion during the PhD defense, would it be okay if I open up the thesis pdf file to answer some questions, for example to refer to a figure or equations? or should everything be already on the slides and prepared before?
While I agree that it would be OK to open a pdf of the thesis to show a specific part as an answer to a question I would like to add:
Opening up the thesis and show something in addition to the slides in the middle of the talk would show that the talk was not well prepared. So don't do that and prepare your talk such that this will not be necessary.
Having answers and arguments to questions ready without going to the thesis would appear better. Of course, nobody expects you to know every word from your thesis but it is expected that you know all results of your thesis and also all your arguments.
Opening the thesis when a question like "on page X in Theorem Y you state that…" comes is totally OK. Especially, since this gives the rest of the audience the chance to follow the discussion.
But finally: It's a thesis defense. It usually not an event where anybody fails terribly. If you know what you have written about and know what you are talking about nothing bad will happen.
My committee members all showed up to my defense with the printed copies of my thesis that I had left for them for their comments, so if we needed to look something up, there were 5 hardcopies already in the room. It's fine.