They can get fired. If they're still an H-1B, that basically requires them to leave the country immediately.
There's a short grace period in practice (usually, and this isn't official) if you have another job all lined up that is ready to sponsor you. But if you were an H-1B applying for a green card via your employer, this basically resets your position in line, unless you're in late stages of the process. And keep in mind that the wait is measured in years for many countries (e.g. for India, >9 years right now unless you're in the "exceptional" category).