Can I get an O-1 with a pending green card case?
Yes. A pending or approved immigrant petition cannot be the reason to deny an O-1 petition, extension or change of status.
Yes. The O-1 regulation says that the filing of an immigrant petition, or the approval of a labor certification, cannot be the basis to deny an O-1 petition, an extension or a change of status (8 CFR 214.2(o)(13)). A pending green card case does not close the O-1 door.
Three situations
You have a pending I-140 and are outside the US. An O-1 visa application at a consulate is not refused solely because of the I-140. The officer applies the same standard as for any applicant for the category.
You are in the US with a pending I-485. Changing to O-1 or extending it is possible, and the regulation protects the petition. But travel is a separate question. An I-485 applicant who leaves without advance parole is treated as having abandoned the application, unless in H-1B or L-1 status, so an O-1 holder usually waits for advance parole before a trip (8 CFR 245.2(a)(4)(ii)).
You are the O-1 holder and the green card case is through the same field. This is common: an O-1 worker files for an EB-1A or EB-2 NIW using the same evidence. The two petitions are independent, and approval of one does not decide the other.
Why people want an O-1 during the green card wait
A backlog can leave a worker without valid status for years. The O-1 has no six-year limit, no lottery, and extensions in one-year increments, so it can carry someone through a long wait. The same is true for the H-1B only up to the AC21 extensions the green card process allows.
Who it applies to
Beneficiaries of a pending I-140 or I-485, in a field where they can show extraordinary ability. It does not help someone who cannot meet the O-1 evidence standard.
What goes wrong
Travelling on an O-1 during a pending I-485 without advance parole.
Statements at an interview or border that sound like a decision to move permanently, without reference to the regulation's protection.
Letting the O-1 lapse because the green card seems close. USCIS can deny the green card for a status violation in some cases.
How much weight to give the green card case when choosing to extend or travel is for an immigration attorney to weigh.