It’s more that guilds managed the distribution of workers, so that there weren’t too many workers in a given area relative to how much work there was for them. Now, masters tended to have much more freedom than journeymen in terms of where they could go, because that’s part of what it meant to be a master, but there were still internal pressures to not overcrowd the market.
So it would depend on the local economy. If there is a scarcity of local blacksmiths, a foreign master would be readily welcomed, as masters were required to train apprentices and employ journeymen, so a new master would (over time) create new jobs in that industry. If there were a lot of local blacksmiths, there might be resistance, b/c the argument would be that additional masters would split the work too much.
In terms of enforcement, this is where guild charters came in: guild regulations had the force of law within that industry, so if you tried to move to a city after being refused permission (and thus weren’t licensed), you could be sued in court and the local gendarmes could expel you from the city.