Most countries legally require licensed taxis to run a meter for standard hails, with airports often operating a parallel system of official fixed fares or prepaid counters that replace the meter for those routes. Both are legitimate; the trouble lives in the gap between law and practice, which varies from places where meter refusal is unheard of to places where it is the daily opening move with foreigners.
Protecting yourself is mostly routine. Use official ranks rather than drivers who approach you, confirm the meter starts when you set off or agree a total price clearly before moving where negotiation is the norm, and keep a ride-hailing app estimate in your head as the fairness benchmark, since the app quote reveals the going rate for any route in seconds. At airports, a posted fixed-fare board or prepaid window is the scam-proof option whenever offered.
If you are overcharged, note the taxi's license number, displayed inside the cab and on the plate, photograph it, pay what is plausibly correct, and report through the city's taxi complaint line or tourist police. Drivers take recorded complaints seriously because licenses are at stake, and just visibly noting the number often resolves the dispute on the spot.