Upvote:4
The pandemic situation notwithstanding, if your F-1/J-1 or another status is still valid, you will be able to apply visas inside the US for most countries.
For short-term visas, the UK does not require being a resident at all (but you should be legally present in the country you are applying from); however, it is recommended to submit a confirmation of legal residence to justify your personal circumstances. In any case, your I-94 (proof of legal admission) in combination with I-20 (proof of student status) should suffice. Expiration of your visa does not matter if your I-94 is still valid.
As you are aware, you will need a new US visa before returning to US after your exchange.