Is it possible in practice? Yes. However, you need to check any passport/ visa conditions based on your nationality as well as any applicable PCR testing regulations.
From your point of origin, the airline staff will treat your end destination as Dubai and apply those visa & covid requirements (instead of as a transit point).
You also need to consider how much time is between flights, PCR testing on arrival (if applicable), arrival & departure terminals and how to get across. If planned properly, it can be done - no issues.
Ro