Q: What happens if someone works in 10 countries to his retirement?
If they happen to be 10 EU countries, then in the last country that person worked in he should apply for pension and get pension combined from all the countries he worked in.
As Europa.eu portal explains,
if you've worked in several EU countries, you may have accumulated pension rights in each of them, but you only apply in one, which ought to take care of aggregating them.
When the time comes for you to claim your pension, you'll have to
apply in the country where you're living - unless you have never
worked there. In this case, you should apply where you last worked.
That country is then responsible for processing your claim and
bringing together records of your contributions from all the countries
you worked in.
[...]
If you've worked in several EU countries, each country's pension
authority will first calculate your pension using its own rules, based
on the contributions you paid there (known as independent benefit).
Q: Is it possible in EU to withdraw a portion of the contributions for
retirement?
This depends on individual regulations in each country. As far as I know, most European countries do not allow withdrawal of retirement contributions.