Duplicate content can be created in many ways.
domain.com/index.html?id=shoppingcartuserid This is before considering subdomains. Are these pages quote unquote spam? no but they are also not ideal.
It is a waste of space for the search engine to maintain more than one URL to the content. So the URL with the greatest SEO authority is used. This is what I would expect in the OP case.
Other people sites plagiarize content so the first to publish is normally the winning URL unless the plagiarizer is a major site with lots more SEO authority. More often than not the plagiarizers don't have SEO authority and zero original content, which is where penalties begin to kick in against the scrappers plagiarizers. If a sub-domain was indexed then the main domain was indexed and the sub-domain was dropped it may feel like a penalty, but overall it is a wash.
To get both subdomain and main domain preforming well place different content on each, which is better for the visitors and better for the site. If you split your incoming link authority between a sub-domain and main domain your site ends up in a weaker position.
The subdomain should share style, or branding with the main site, not text.
Updated based on comments below
Google maps, or places, and local sites that review brick and mortar businesses are extremely helpful for sites where the only difference in the product is the location; Examples would include construction businesses, Carpeting suppliers, lumber retailers, grocery stores, etc. BBB links if available can help compete in a commodity marketplace.