Some states have chosen to allow illegal immigrants to get driver's licenses; other states either officially do not, or, like NJ, have a driver's license process which is impossible for an illegal immigant to complete (an illegal immigrant, by definition, would not have certain of the required documents). You need to check the rules for  your specific state; the best way to be certain would be to contact your DMV, either online or by phone. The fact that you are looking to legalize yourself will not matter--all that matters is your status when seeking the license.