Can a thesis contain preface?
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.

Ideas and Explorations : Brouwer's Road to Intuitionism

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.