Legality of remote work in other countries?

Are there any resources for figuring out if it’s legal to work remotely for a company based out of X country in Y other country?

If you read the above post, please read the following post as well.