As pcsnyder noted, this depends on which style guide you are using. True, in the case of a thesis or a dissertation, the style manual of the institution1 is rarely detailed enough to specify a particular citation style, so candidates normally default to the standards of their field.2
1The University or whatever is the relevant subdivision of it. In the US, the relevant authority within a university is often something called the 'Graduate School' or the 'School of Graduate Studies'.
2In fact, at least in the US, the style guides of many graduate schools explicitly say that this is what should be done. Just make sure your Thesis/Dissertation Committee, in particular the Chair of it (who is probably also your thesis/dissertation advisor), is OK with your choice.
The MLA style was covered by pcsnyder, above.
Another major style is the Chicago Manual of Style (CMOS). Students and researchers often use the Turabian style, which is nowadays identical to CMOS (see here and here). In its 17th edition (which is the most recent, as of 2020), CMOS says this:
14: Notes and Bibliography
14.129: Place of publication—city
The place to be included is the one that usually appears on the title page but sometimes on the copyright page of the book cited—the city where the publisher’s main editorial offices are located. Where two or more cities are given (“Chicago and London,” for example, appears on the title page of the print edition of this manual), only the first is normally included in the citation.
Oakland: University of California Press
Los Angeles: Getty Publications
New York: Macmillan
New York: Oxford University Press
Oxford: Clarendon Press
14.130: When to specify state, province, or country of publication
If the city of publication may be unknown to readers or may be confused with another city of the same name, the abbreviation of the state, province, or (sometimes) country is usually added. Washington is traditionally followed by DC, but other major cities, such as Los Angeles and Baltimore, need no state abbreviation. (For countries not easily abbreviated, spell out the name.) Chicago’s preference is for the two-letter postal codes (IL, MA, etc.), but some publishers prefer the conventional state abbreviations (Ill., Mass., etc.). See 10.4, 10.27. For Canadian provinces and territories, see 10.28.
Cambridge, MA: Harvard University Press
Cambridge, MA: MIT Press
Cheshire, CT: Graphics Press
Englewood Cliffs, NJ: Prentice Hall
Harmondsworth, UK: Penguin Books
Ithaca, NY: Cornell University Press
New Haven, CT: Yale University Press
Princeton, NJ: Princeton University Press
Reading, MA: Perseus Books
Washington, DC: Smithsonian Institution Press
Waterloo, ON: Wilfrid Laurier University Press
Cambridge: Cambridge University Press
When the publisher’s name includes the state name, the abbreviation is not needed.
Chapel Hill: University of North Carolina Press