I currently work remotely for a NY based company, from South America.
AFAIK, what makes it possible is that we are hired as freelancers/consultants/contractors under what I understand is a pretty standard "Work for Hire" contract.
For the tax side of things, the company needs remote workers to sign a W-8BEN form (W-9 if the remote worker is a US citizen abroad), which states that the worker takes care by himself of taxes in his own Country.
Hope that helps.