That really seems like something that can be figured out, especially if the result is 3x less in wages.
Unlike immigrating to the US, which is sometimes plain impossible.
They don’t hire that Brasilian to be their employee. The Brasilian is a one-man company. They contract the company to render whatever service. The Brasilian company does whatever Brasiliantaxes and procedures are necessary.
I know a first-world company hiring third-world people. All the taxes are handled by the contractor himself. There are no legal issues to speak of, you only need an invoice from the contractor, or from an intermediator company, such as fiverr.