It really depends on what class are you talking about. If you are under skilled worker, then you got to have H1B before you move on to the next stage. If you are eligible for NIW, then you don't really need H1B to file application for GC as long as you have a valid status in US.