Yes, and this surprises some first-time travelers: public transport in almost every country is a public service, not a residents-only system. Tourists ride the same buses, metros, and trains as locals, buy the same tickets, and follow the same rules. Nobody checks your passport at a bus door.
The practical differences are mostly about payment convenience. Locals often use registered transit cards, annual passes, or accounts tied to local bank details, while visitors typically use single tickets, day passes, or tourist passes. Increasingly, cities let anyone tap a contactless credit or debit card directly at the gate, which erases the difference entirely and is usually the easiest route for a visitor. Where that is not available, the station ticket machine or the official app serves everyone.