Yes, forex trading is legal in the United Arab Emirates (UAE) such as Dubai and Abu Dhabi.
Retail investors in the UAE wanting to trade forex and other CFDs need to ensure their broker is regulated by the Dubai Investment Financial Center (DIFC) which is the regulatory body with oversight for the Dubai Freezone or Abu Dhabi Global Markets (ADGM) for Abu Dhabi. The Central Bank of the United Arab Emirates (CB of the UAE) also acts as a regulatory body.