Thats how it works for me working in Mexico in a US company. There are several PEOs like Globalization Partners or via.work (these last are Ycombinator alumni I think).
I get all the legal benefits from being employed in my country and the advantages of working for a US company.
I get all the legal benefits from being employed in my country and the advantages of working for a US company.