I'm new here, so there may be an exception I'm not aware of, but per the official instructions:
https://grapheneos.org/install/web#enabling-oem-unlocking
If the settings option to enable OEM unlock is greyed out, you will not be able to install GrapheneOS. Buying your pixel unlocked directly from google should reliably avoid this issue. If you can physically test the device before buying, check the instructions referenced above to enable developer options, then see if the OEM unlock toggle is available. The phone will need to be connected to the internet (wifi is fine) to check this, as the serial # is referenced to a list on google's servers to check if it is locked or not.
Good luck, and really encourage you to migrate to GrapheneOS, it is outstanding so far with my admittedly limited usage experience.