You simply need to be a legal resident in the country you are applying from, i.e. a valid residence visa and not a tourist or visitor visa.
Note that overstaying your visa in any country can have implications for future applications in the UK as this questions is asked in most application forms.
Char (CR001 not Casa)
In life you cannot press the Backspace button!!
Please DO NOT send me a PM for immigration advice. I reserve the right to ignore the PM and not respond.