Usually preface is written in books and myself personally have not seen it in a thesis.
But, can a master's or doctoral thesis contain a preface?
Academia Stack Exchange is a question and answer site for academics and those enrolled in higher education. It only takes a minute to sign up.Sign up to join this community
Note: This was going to be a comment, but then I realized it actually answers the question that was asked.
The following 2004 Ph.D. dissertation at Utrecht University has a preface on pp. xi-xviii, so the answer is YES.
However, the question you possibly want answered is whether a Ph.D. dissertation at YOUR university can have a preface. To find the answer, you can ask someone knowledgeable about the specific dissertation format rules at your university, or you could visit the library shelves where recent Ph.D. dissertations are shelved and spend 20-30 minutes quickly flipping through the first few pages of the 100-200 most recent dissertations, keeping in mind that for some universities the answer might be department-specific.
It's your work, so unless there are rules to the opposite, I would say go ahead. Many theses contain acknowledgments in a preface, for example -- most of the time thanking real people, but sometimes also their dog, a brewery, or imagined events. Read through enough theses and you will get the idea.
So, see whether there are rules, and if there are none talk to your adviser what is appropriate. Beyond that, you're the author and decide how best you want to say what you want to say.