It depends on the ground for the denial. If there is a determination that you engaged into a fraudulent marriage, then H1 is not an option. You will need a fraud waiver.
This answer is for informational purposes only and should not be construed as legal advice.
The procedural consequences are straightforward: if the I-751 is denied, then after 30 days, you will be issued a Notice to Appear and placed in removal proceedings- there is a policy memo making this non-discretionary. To get an H1B after an I-751 denial, you would need to leave the country promptly, and come back with a valid H visa.
This is general information only. It is not intended as a substitute for legal advice, and does not create an attorney-client relationship.
The fact that you tried to immigrate can create complications. It's unclear whether the fact that the condition expired and you were denied a joint petition and/or self petition will affect you.
You should have a competent and experienced immigration attorney review the evidence that proves that your marriage was entered into based upon a good-faith relationship. Good luck.
This is general information, not legal advice, and does not create an attorney client relationship.