The same idea exists in the US, and often bathrooms have a PIN code to enter or a special key only the shop owner has.
I’ve never been turned down when asking politely. Most people are rather sympathetic when someone needs to use the bathroom for legitimate purposes.