Our UK sex laws are confusing, particularly those around sex in public places.
Your best guide is to look at what the Sex Offences Bill says about it...
71 Sexual activity in a public lavatory
(1) A person commits an offence if -
(a) he is in a lavatory to which the public or a section of the public has or is permitted to have access, whether on payment or otherwise,
(b) he intentionally engages in an activity, and,
(c) the activity is sexual.
(2) For the purposes of this section, an activity is sexual if a reasonable person would, in all the circumstances but regardless of any person's purpose, consider it to be sexual.
(3) A person guilty of an offence under this section is liable on summary conviction, to imprisonment for a term not exceeding 6 months or a fine not exceeding level 5 on the standard scale or both.
You can read the whole lot at the HMSO website.
So, if you expose yourself, have sex with someone else in view of others, or invite sex from someone, then you could be liable to prosecution if you were caught or someone complained about you.
Some police forces and neighbourhoods can be more lenient, but the problem is that it's not always clear where these places are, or whether you're likely to cause offense to another person.
It seems if you have sex in public with nobody else around it's likely you'll be okay.
But have sex where others could see, or invite them to come look at you having sex in public, and you could face prosecution.
If you have sex within a toilet cubicle, you're less likely to be noticed - if you're quiet! - but you can still get into trouble if you're noticed or again someone complains about you.
My advice is be careful where you have sex, ensure you have sex with someone who you’re certain wants it - and if in doubt, don't approach!
Remember, the laws differ in different countries so again, check before you travel if you want to have public sex.