All towns have a market where you can buy and sell goods. The prices change over time in accordance with supply and demand, so producing too much of the same thing can often be inefficient due to spiking the price of the raw material you need while simultaneously driving down the sale price you can get for the finished product.
Note that at any particular market, at any particular time, your price for buying any product will always be higher than what you'd get for selling the same product. However, you may occasionally find that your town's market is willing to buy a product for a price higher than another town would be willing to sell it for. In this case, you can buy that product where it's cheaper and sell it where it's more expensive to earn a profit.