Well, if you define marketing as advertising, then it’s clear you need the product first.
Marketing is not the same as advertising.
Advertising is a tiny slice of what marketing is today, and in fact, it’s pretty clear that the marketing has to come before the product, not after.
A lot of products were produced after a lot of marketing (including market research) has been done.
Don’t look for customers for your products, look for products for your customers.
This means you need to know what you customers want first, then based on what they want, go out there an source (produce, innovate) products for them. This will result in a filling a gap in the market where there is proven demand. This is what entrepreneurship is about, filling a gap in the market.
In fact, just about every successful product or service is the result of smart marketing thinking first, followed by a great product that makes the marketing story come true.
If someone comes to you with a ‘great’ product that just needs some marketing, the game is probably already over.