In most countries, monthly passes are open to anyone who can buy one, resident or not, because the systems are anonymous smart cards or app-based tickets. Tourists in cities like London, Paris, Berlin, Tokyo, or Singapore can load a monthly or weekly product onto the standard transit card without showing any residency papers.
The exceptions are discounted or subsidized passes. Heavily reduced monthly cards for students, seniors, or low-income residents usually require local ID, proof of address, or enrollment documents, so those are effectively resident-only. A few systems also require registering a photo card for period passes, which takes a passport photo and a form rather than residency as such.
If you are staying less than a month, run the math first. A monthly pass often only beats pay-as-you-go if you ride twice a day for most of the month, and many cities cap daily or weekly spending automatically on contactless cards, which can be cheaper for a two or three week trip. Check the operator's official fare page rather than third-party resellers.