Even a socialist such as Sanders understands that allowing open borders is a recipe to have the resources that you're trying to redistribute to your countrymen looted by (hostile) foreigners.
Very few socialist states throw open their doors to let anyone in (or out, for that matter). To the extent that it "works," it only works in a closed system.