you have to have legal status as in be a legal alien, but i do not see a problem with becoming a lawyer in private practice. a judge my be a little more difficult as it is an important government job and in some places they are elected.
Yes you have to be an American or legal resident to be admitted to any state bar association/ admitted to practice in the Federal Courts. You can't practice law without bar association admittance.