Homosexual acts are illegal under UAE law, and those accused can incur deportation, fines or a jail term. Discretion here is key.
You cannot access many LGBT+ websites and dating apps such as Grindr from inside the UAE.
Note that all public displays of affection (cuddling, kissing and hand-holding) between opposite-sex couples are also illegal in the UAE as is sex outside of marriage. A same-sex couple sharing a room is likely to be construed as companionable or cost-cutting, but unless you're staying at a five-star resort, where staff are likely to look the other way, it's advisable to book two single beds rather than a double bed.
Despite this, there is an active but very underground LGBT+ scene in Dubai and Abu Dhabi because of the large number of young international residents, though tapping into it can be difficult as a visitor on a short stay.
A useful read is Gay Travels in the Muslim World by Michael Luongo.