no place in the wasteland produces anything of value, not even food,
Actually they do.
-Rivet city produces food such as carrots, potatoes, apples, and pears, which it trades for scrap metal to do repairs on the ship. It also gets a large amount of mirelurk meat from the mirelurks constantly trying to inhabit the lower levels of the ship.
-Arefu, The Regulators, Canterburry Commons, and The Republic of Dave, have multiple Brahmin which provide them with milk, and meat. Larger towns such as Paradise Falls and Megaton have Brahmin also, though obviously not as much since they are compact cities, not large enough to sustain multiple Brahmin like the smaller towns out in the wilderness. There are even several small herds of wild brahmin in the wasteland to get food from.
-There are a number of randomly encountered hunters from various towns in the game world, hunting mirelurks, yao guai, mole rats, and even feral dogs, for meat which they trade.
-Scavengers from various towns can be found around the wasteland collecting everything from mutfruit to the old pre-war food.
-The larger towns such as Megaton, Tenpenny Tower, and Rivet City, produce small amounts of clean water they can trade.
The idea that they don't produce things is demonstrably false, and easily disprovable by anyone who has played the game.
But even on top of that, due to the hostile nature of the wasteland, big cities like Megaton can simply trade safety for items. People will be willing to trade some ammo, guns, or food, to be able to stay inside Megaton's walls for X numbers of days.