"The girl also broke the law.
She was 17 and in a consensual relationship, but the mother waited until her Dd was back in the UK so that the boy could be prosecuted and imprisoned while her Dd was safe"
She was underage by the dubai law and would not have been prosecuted. The UK would similarly not prosecute anyone under the age of consent as by law they are unable to consent to sexual activity.
This has been discussed on this thread previously along with the fact that the mother who reported the sexual activity didn't find out about it until she was unpacking the luggage and found contraceptives.
None of this changes that both of them were subject to Dubai law and justice system while in the Dubai.