Not familiar with any airport in Dubai, but as long as you checked your baggage to the final destination at your departure point (i.e. you will not take baggage in Dubai and re-check it again) 2 hours should be plenty of time to transfer between flights, even if they are on different terminals.