It does happen, and it can happen in both directions in terms of quality. Some stores will demand better quality goods or extra perks (you will often see a vacuum, for example, with an extra caddy of parts at Costco). Note that this generally only happens for only true large stores and chains, as it is another layer of expense on the seller (different build, different paperwork, different labelling, etc). This is not a demand that just any small store is going to get met. It will happen for certain quantities of goods only and is negotiated well in advance.
Note that Walmart, Amazon, and Costco, all do a lot of reasearch to find out who shops at their stores, and what options or features their key buyers are most interested in. They are not the same target buyers.
The chains do not do this for every single item they sell. They target certain types of products, depending on a whole range of things, including time of year, volume, margin, and on, and on.
It has not been my observation that Amazon changes their products. Resellers on their site might do so, and products running on their OS (think Kindle or Fire) might be different. This could, of course, change.
Walmart uses the system to maintain their price points.
Best Buy, in part for this reason, and in larger part for some other longer supply chain reasons, has really broken their own business model.
CostCo and others make it work for them in a slightly different way.
Another place you will see something similar is in something called a “white label”, or store name model. Sears does not make Kenmore, for example. They use other companies to do it for them.
Cite, for now, decades of working in consumer sales and product marketing.