Upvote:3
Regarding Brazil: Brazil only has "regular" visas, not transit visas. If you need one it will depend if the leg DXB->GRU->PTY is a single ticket or not.
If it is a single ticket, and you do not leave the international transit area, then Brazil does not require a visa for any nationality (2017 migraton law, art. 13, Β§3).
But if you have multiple tickets for this leg, or if you need to leave the international area to obtain a new boarding pass, then you as a Pakistani must have a visitor visa.