Upvote:1
According to this https://www.gov.uk/government/publications/where-to-apply-ecb05/ecb5-where-to-apply-the-policy you can apply in any country where UK entry clearance applications are accepted, provided you are present legally in that location.