I am a Pakistani passport holder living in Italy. I have an Italian ID. I'm going to Pakistan with Qatar Airlines, staying 2 days in Dubai. Do I need a visa or visa on arrival for these 2 days?
Yes you do. Pakistani citizens require a visa to enter the UAE.
You can apply for a transit visa from your airline. Your passport should be valid for more than 6 months and you should have a hotel reservation for the duration of your stay, and return tickets.
Check with your specific airline the procedure to apply. You can also apply on arrival, however from experience the process is a lot simpler if you go through the airline.