Yes, they can sound very different.
It’s not really about the cost of the guitar. Expensive guitars are made from better materials, tend to look nicer, feel better and, generally play better. But do they sound better?
If you use the same amp, effects and guitar player then the vast majority of tonal differences on electric guitars comes down to the pickups. If you understand how the physics of guitars works, then you should understand that probably more than 90% of the guitar tone comes from the pickups and associated electronics.
And it’s a fact that different pickups sound different (not necessarily “better” as that is a subjective judgement). For a start you have different types (single coil, humbuckers, P90s, etc.) which have very different sounds. Then, even within a specific type, two single coil pickups (for example) can sound different due to how they are made: different magnet types, number of windings, etc.
And, again, I would kind of dispute this is about cost because the difference in component costs between a cheap pickup and an expensive pickup are not vast.
Although, in practice, it can be about cost because of marketing: you generally don’t set your price based on your costs, but on what the market is willing to pay. Brand name, well regarded pickups will command a higher price which doesn’t directly reflect the cost of manufacture.
But there’s nothing stopping a manufacturer, like Yamaha, making decent pickups and putting them in lower-priced guitars.
So, let me fix your question for you:
Yes, I have a number of guitars including a decent Fender Tele, a decent G&L Tribute (basically a more modern version of the Strat, designed and manufactured by Leo Fender under a different brand name) and a PRS S2 Singlecut. I also have a Gibson SG with P90s.
All of these sound different because they have different pickups and pickup wiring/electronics in them. The humbuckers in my PRS sound fat and round, but can sometimes get a bit muddy. The single coils in my Tele sound bright and “twangy”, whilst the single coils in my G&L and my Travelcaster sound bright and less “twangy”, although with some adjustment of the controls I can make my single-coils sound similar to each other.
The P90s in my Gibson are bright but have a bit of a “growl” to them. That might just be because they are higher output and drive the amp more. They also feel a bit fatter than the single-coils. The P90s in my Revstar sound a little similar although, I would say, less aggressive. On the Revstar I also have the out-of-phase settings (positions 2 and 4) which the SG doesn’t have, as well as the “boost switch”, which gives tonal variation.
A couple of years ago, I also had a dirt-cheap no-name brand “Swing S100” Strat copy. That sounded great.
Cheers,
Keith