I want to get a round ticket to Dubai then to Srilanka.
I travel to Dubai by Qatar Airways which stops in Doha then goes to Dubai, then travel to Srilanka and return to Dubai by another airline.
Do I need a transit visa for Dubai both times?
Based on Timatic (the visa system most airlines use), Iraqi citizens do not require a visa when transiting UAE airports as long as they are departing from the same airport within 24 hours of arrival. You will NOT be allowed to go landside, however especially at Dubai there is no need to.
Note that as for many countries, UAE does not allow entry or transit to holders of Iraqi "S" series passports (ie, non-machine readable passports)