As far as the UK rules go, you need to apply for your visa in a country in which you are usually habitually resident. If you are considered to be usually habitually resident in the USA then you can make your application from there.
I don't quite understand what you mean when you say that he was deported from the USA but that he is still there.. Was he deported or not?
If he wishes to study in the UK, he will need to get accepted onto a course of study in the UK and then make an application to the British Embassy in the USA to come here under Tier 4. Even if he meets the rules the fact he was previously deported from the USA may raise some questions but it depends on why he was deported. If he committed criminal offences then this could hinder his application to come to the UK.
The act of being deported means that you are removed from the country so do you mean he was physically removed from the country and then he has re-entered illegally or that he has just been served with deportation papers but he never actually left?
As I said above, in order to make an application to come to the UK, he will need to go through the embassy in the UK. If he is living illegally in the USA, then it is unlikely that they will accept his application although there is a possibility that they might.
It is up to your friend as to whether he wants to try. He needs to be aware that whether his application is successful or not, he will lose the fee he pays. It's therefore his choice whether he takes that risk or not.
Obviously if he doesn't satisfy he criteria for the visa he is coming on then he is unlikely to be successful.
DISCLAIMER: Answers from Experts on JustAnswer are not substitutes for the advice of an attorney. JustAnswer is a public forum and questions and responses are not private or confidential or protected by the attorney-client privilege. The Expert above is not your attorney, and the response above is not legal advice. You should not read this response to propose specific action or address specific circumstances, but only to give you a sense of general principles of law that might affect the situation you describe. Application of these general principles to particular circumstances must be done by a lawyer who has spoken with you in confidence, learned all relevant information, and explored various options. Before acting on these general principles, you should hire a lawyer licensed to practice law in the jurisdiction to which your question pertains.
The responses above are from individual Experts, not JustAnswer. The site and services are provided “as is”. To view the verified credential of an Expert, click on the “Verified” symbol in the Expert’s profile. This site is not for emergency questions which should be directed immediately by telephone or in-person to qualified professionals. Please carefully read the Terms of Service (last updated February 8, 2012).