A UBI should cover the cost of housing and food, though it does not guarantee that you can live in a highly-sought after area without other income. That must be factored into employee compensation in the same way that it already is for desirable jobs today. It puts more pressure on cities to ensure that close, affordable housing exists for the lower-wage workers like retail and service workers who help make those cities desirable places to live. A job at a swanky downtown coffee shop with an hour commute becomes a lot less attractive if I can ditch that job and the transit costs without worrying about my basic survival. So the coffee shop has to increase pay or lose its employees and close up. Its downtown location and clientele will either absorb the price increase, or downtown will become a less competitive living space due to the loss of the business.
A UBI will not remove all of the reasons someone can’t pack up and leave if the area is too expensive, there are lots of human factors in play, but it will increase people’s ability to move elsewhere without having to fear for their very survival.