Do you ever put overpowered monsters in the party's path?
Yes.
Well, rather I put things in their path & they decide how they're going to deal with it. The choices they make determines if the thing is overpowered or not.
For example, is it ever possible for a party of level 4 dudes to encounter an adult red dragon?
Yes. In fact I opened a campaign with an adult dragon encounter several years ago. The party, all 1st lv, were heading upstream on a river barge. The VERY 1st thing that happened was an adult green dragon swooping down on them & attacking the barge. Roll initiative.
Several PCs (and NPCs) jumped overboard & swam for shore.
1 PC hid in the wheelhouse with a few NPCs.
Another PC hid behind the corner of said wheelhouse & shot at the dragon with his xbow.
The dragon ignored the xbow bolt, took a round to scuttle the boat, grabbed a horse, & as it was leaving casually turned the wheelhouse to splinters with a tail slap. Just because it could. The damage it caused to those hiding in/next to the wheel house was purely incidental.
Fortunately for the PCs none of them did anything really stupid like charging into melee or casting Magic Missle on it.
This encounter
1) established that there was an adult green dragon living in the area,
2) put the PCs ashore where the actual 1st lv aventure would be occurring during their overland trek.
And if so, how do you impress upon your PCs that fighting might not be the answer?
I generally don't bother/have to. Most of the people I play with are veteran gamers & fellow DMs. They know there's multiple ways to deal with an encounter, not just combat. (they also know the books as well as I do).
The rest, though new to this stuff, are fairly smart. I describe a creature & they use their own judgment as to wether stabbing it seems like the right choice.
And they all know that I've no qualms about killing characters. I roll the dice in the open & let whatever results occur stand.