this is just a hypothetical question..
It completely depends on the reason for denial. If you applied before being eligible it doesn't have any consequences for your GC. However, if USCIS is denying because they find you committed a deportable offense or that you had abandoned your Green Card they might revoke the GC. However, I haven't seen a case like that yet.