Can non-US citizens play? What if a non-US citizen wins?
Yes, non-US citizens can legally play, and non-US citizens are eligible to win any prize offered in the game.
If a non-US citizen wins, they would claim their prize in the same manner that a US citizen would, but the taxes withheld would be different. For example, federal withholding for non-US citizens is a flat 30%. Also, individual states may have different tax structures for non-US citizens than they do for US citizens. Depending on which country the person is a legal resident of, there also may be tax treaties between the US and that other country which could be helpful in offsetting whatever the US tax liabilities are.
In short, non-US citizens can play and win Mega Millions. If a non-US citizen wins a large prize, they will be responsible for some amount of tax, which in the end will probably be an amount similar to what a US citizen would pay, but there are so many possible variations with international tax codes that you’ll need to consult with a local tax attorney if you need to know a precise amount of tax liability.