You don't have to pay taxes nor social security for 20+ years in order to become a citizen in very many countries. You can live on benefits before becoming a citizen and after becoming a citizen. Usually the requirement is that you are a resident for a set number of years in order to become a citizen.
Most countries have contribution-tested benefits if not means-tested. You definitely can't fast-track citizenship and then start receiving benefits and fuck off.
> You can live on benefits before becoming a citizen and after becoming a citizen
What benefits? I don't know every country in the world, in Germany unless you count retirement as a benefit (which is something you pay for and have to reach a certain age that is ever moving upwards) you don't get any assistance if you're not living in the country.