It is a city that projects itself as a sophisticated, ultra-modern destination for Western travellers.
Not all of us have holidayed in Dubai but many of us have spent time there, due to its status as a major international travel hub and home to the world's third busiest airport.
Most of the 14 million people who visit the glittering Emirati city each year come away with only positive experiences of their time there. But many others have discovered that for all its luxury shopping, lively night-life, advanced technology and record-breaking feats of architecture, Dubai can be very archaic when it comes to the law - and it shows little mercy.
This week, Scottish tourist Jamie Harron was finally freed after being sentenced to three months in jail after he was accused of public indecency for touching a man's hip at a crowded Dubai bar.
But Harron is not the only tourist who has gotten banged up in Dubai for a seemingly innocent mistake.
PLANE-SPOTTING
Three friends landed from the UK were accused of espionage and held in prison for eight weeks after they were caught plane spotting near Fujairah airport, about 130 kilometres from Dubai.
According to The Guardian, the men were taken to a police station where they signed an Arabic document in which they apologised and promised not to go plane-spotting in the UAE again.
They were sent to prison but eventually released without charge.
Radha Stirling, the founder of the UK-based advocacy group Detained in Dubai, which supported the trio, said the case against them was "ridiculous".
PUBLIC DISPLAYS OF AFFECTION
You might have heard rumours that publicly kissing and touching your partner can land you in hot water in Dubai - and that is absolutely the case.
In 2008, a British couple was given a three-month suspended sentence for having sex on a beach, while in 2010 another British couple, who were merely friends, spent a month in jail for allegedly kissing in a restaurant.
And an Indian couple were sentenced to three months in jail for exchanging flirty text messages.
It's also worth noting Dubai's strict stance against extramarital sex also makes it illegal to share the same hotel room with someone of the opposite sex to whom you are not married or closely related.
SUPPORTING OVERSEAS CHARITIES
Last year, Australian man Scott Richards was detained in a Dubai cell accused of illegally supporting a US-based charity.
Mr Richards, who is from South Australia but had worked in Dubai for 10 years, shared a Facebook post in support of a charity working to fund medical procedures and treatment for refugees in Afghanistan.
The father-of-two was detained under recently introduced laws prohibiting people from promoting overseas charities. Officials have since dropped the case.
ACCIDENTALLY USING FAKE CURRENCY
This isn't a situation many of us would find ourselves in, but this month an Edinburgh father was arrested and stripped of his passport for passing on a fake £20 note (about $37) in Dubai.
Billy Barclay, 31, was handcuffed and arrested in front of his horrified wife and kids at Dubai airport and was imprisoned for three days before being released on bail.
Mr Barclay says his use of the note was a "mix-up" and he is awaiting his fate.
MAKING OBSCENE GESTURES
While this is considered bad manners everywhere, it's strictly against the law in Dubai.
And a British IT consultant has learnt this the hard way when he was arrested for sticking up his finger to a driver.
The incident happened in February as Jamil Ahmed Mukadam, 23, drove his wife to the airport in a hire car and a driver started tailgating them, The Guardian reported. If convicted of public indecency he be jailed for six months.
Dubai also has strict laws against swearing: last year, a court fined a local man $1160 for swearing at another man on Whatsapp.
VARIOUS SOCIAL MEDIA ACTIVITIES
Dubai introduced strict cybercrimes laws in 2012 and it's led to the arrest of numerous tourists.
In 2013, an American was sent to jail for making a parody video about Dubai's youth culture. Also that year, police arrested a man who filmed an incident in which a government official attacked a van driver and shared the footage on YouTube. Charges were eventually dropped.
The UAE's strict cybercrimes laws also led to the 2015 arrest of Australian woman Jodi Magi in Abu Dhabi who uploaded an image to Facebook of a car parked across disabled parking spaces.
DRUGS - EVEN WHEN YOU DON'T HAVE ANY
There are strict laws against drugs pretty much everywhere but travellers may be surprised to discover how far that goes in Dubai.
Even a tiny amount of illicit drugs in your blood or urine is considered possession. And you can also get in trouble even if you didn't have any drugs.
In 2008, British tourist Keith Brown was sentenced to four years in jail after Dubai customs officers found a tiny speck of cannabis, weighing just 0.003g, stuck to his shoe.
He was reportedly freed a few weeks later, according to the BBC.
In May this year, a British woman who arrived at Dubai airport with a runny nose was detained after she was falsely accused of snorting cocaine on her Emirates flight.
MFAT warns travellers to be very careful about taking medication into the UAE, as even medication that is available over the counter or by prescription in New Zealand may be considered illicit in the Emirates. That includes Nurofen Plus, as it contains the banned substance codeine.
BEING THE VICTIM OF SEXUAL ASSAULT
There is a long list of cases where Dubai authorities have aggressively prosecuted Western tourists who were actually victims of rape and sexual assault in the city.
Last year, amid huge international outcry at her arrest, officials dropped charges against a British woman who was facing jail after being gang-raped in a hotel room.
After reporting the crime to police, the woman was accused of having sex outside of marriage, a crime punishable by jail time, flogging and even stoning to death. She was eventually freed.
Similarly, Australian woman Alicia Gali spent eight months in a Dubai jail after she was drugged and violently raped, and sentenced to a year in prison for having extramarital sex.
Radha Stirling from Detained in Dubai said such situations were common in the Gulf states.
"Dubai struggles to maintain its promoted reputation of being tolerant, modern, progressive and focused on happiness and positivity, while it regularly victimises women for reporting crime," Ms Stirling said.