The assumption in the example is that the product being sold is a commodity, which cannot be differentiated significantly in terms of pricing or quality.
It limits its applicability, but it doesn't mean the model is incorrect.
"In Hotelling’s Location Model, firms do not exercise variations in product characteristics; firms compete and price their products in only one dimension, geographic location. Therefore, traditional usage of this model should be used for consumers who perceive products to be perfect substitutes or as a foundation for modern location models."
It limits its applicability, but it doesn't mean the model is incorrect.
https://en.wikipedia.org/wiki/Location_model
https://saylordotorg.github.io/text_introduction-to-economic...
"In Hotelling’s Location Model, firms do not exercise variations in product characteristics; firms compete and price their products in only one dimension, geographic location. Therefore, traditional usage of this model should be used for consumers who perceive products to be perfect substitutes or as a foundation for modern location models."