For a foreign national looking to obtain a Buy to Let Mortgage it can be a difficult exercise. If living in the UK and have permanent rights to reside then all should be absolutely fine and indeed on other forms of Visa such as tier 2 the prospect of obtaining a Buy to Let should be able to be realised. It may now depend on how long you have been in the UK and your employment status but there should still be options available to you.
If you are a foreign national however, now not residing in the UK, things tend to be that little bit more difficult. There are however, some, albeit limited in the availability, and very specialist in their underwriting, who will consider this. Do not expect the background checks to be much more involved and stricter due to the additional risks the lender has in making any decisions to proceed.