In most of the canon stories, if you get fired from a corporation, you not only lose your corporate citizenship, you get escorted to the gates (as it were) where you find your personal items (i.e. those not paid for by the corp) waiting for you in whatever boxes they had available to dump them into. And Morlok, extraterritoriality in SR essentially does mean that it's a different country - if the corporation wants it that way. Ares, for example, allows all its corporate citizens in the UCAS (and maybe CAS - I'm not quite up-to-speed on my CAS information) to possess dual citizenship with the UCAS, in keeping with their whole 'Ares = UCAS' schtick. The three Japanacorps (Renraku, MCT, Shiawase) very likely automatically give their people in Japan automatic Japanese dual citizenship, for the same reason.
But in general, how you leave a corporation is dependent on, well, why you're leaving the corporation. You might acquire a national SIN ... but I wouldn't bet on it. One of my favorite short fiction pieces in 5E was of the 'runner walking past the soup line, with the ex-corp armorer who'd specialized in custom grips, sitting on the curb bitching about how he'd gotten canned just before his retirement benefits. Don't know if he had a national SIN afterwards, but considering he was in Puyallup, I somehow doubt it ...