In Germany any lawyer (or the work council) will block you from getting fired (because Google has no legal reason to fire you). What they do here in Germany is to negotiate to mutually void your contract by you accepting a financial package.
So in theory you are right, in practice however, most companies (especially the ones like Google) have to buy you out of your contract.
Also, IIRC, when actual layoffs happen, in Germany they actually need to look at tenure and family status of fired people (e.g. fire people without families first).
So in theory you are right, in practice however, most companies (especially the ones like Google) have to buy you out of your contract.