That's a complicated questions. With limited exceptions, you would need to leave the U.S. to complete the processing of your green card application and almost certainly need to obtain a waiver of inadmissibility. Again with limited exceptions, you also would need to leave if you wanted a temporary work visa status, such as an O-1, although the required waiver would be easier to get.