That very much depends on immigration policies and the way a welfare state is setup.
I am sure that countries with strict policies that mainly allow people to immigrate that a country can be sure these people can contribute to the economy, in such cases sure.
But some countries have very lax policies and (in the name of humanitarian aid) allow many people in from poor areas of the world. At the same time some of these countries might have a large welfare state, with benefits like free or cheap healthcare, schooling, state pensions, medical benefits either free or heavily subsidized, unemployment benefits, etcetera.
For those countries immigration is a huge cost. Many immigrants moving to such countries will never (be able to) work. But they will use a large amount of resources from the welfare state. And perhaps such countries hope children of these kinds of immigrants will be a net benefit, but only time will tell.
Because one additional hurdle is that for many of such countries it’s not expected (and there is little push) for immigrants to integrate into society.
For these countries unrestricted mass immigration will mean the dismantling of the welfare state. As there are too many users of welfare services and not enough people paying taxes to finance the welfare state.
Many Northern European countries fall onto this group.