Depends on the terms of the agreement. In my case the unvested shares had to be returned if I terminated the employment or the company fired me for cause, but not if the company terminated the employment without cause.
I've had clauses like that too, as part of M&A, but haven't seen them in company formation docs. This seems like a thing you can discover quickly and relatively inexpensively.
Yea, this is called a "double trigger" and is often written into founder reverse vesting agreements signed during formation. The idea is that at first, you can be fired as per usual like any employee. But, if there's a significant change in control of the company (e.x. M&A of >50% of outstanding shares), then _one_ of the triggers has been met. At that point, if you're fired without cause, that's the second trigger and remaining unvested shares immediately become fully vested.
Of course, I've since learned that pretty much _anything_ can be re-worked in an M&A agreement -- "we're not buying you without striking this clause" -- so it's no silver bullet.