Your nationality and country of residence should not impact on your University application. It will however impact on your Master's degree fees.
Once you are accepted for admission to university and you have received the confirmation of acceptance for studies (CAS), you can then apply for the Tier 4 visa. You can find all the most updated information you might need here: https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/623341/T4_Migrant_Guidance_29_June_2017.pdf
If the university is a genuine Tier 4 visa sponsor, you are coming to study and you can demonstrate you have enough money to pay the visa fees, your visa should be pretty straightforward. The previous denials should not count against you if you demonstrate you are a genuine student. Be sure to fill out your forms accurately and correctly, leaving no ambiguity. Importantly, you need to demonstrate that you have enough funds to cover yourself, and your course fees for at least one year of study. Be transparent and do not be ambiguous when it comes to the part on the application when you must declare if you have been denied a UK visit visa previously.
Good luck!