Depends on what you mean by 'sound quality'?
Clarity of sound is one thing and even a top quality cartridge can sound awful if full of fluff and grime as it won't track the grooves properly. You wouldn't expect a 50 € TT to sound exceptional just because you put a 500 € cartridge on it.
Different cartridges have different frequency ranges so you may lose detail at the higher frequencies or have muddled lower frequencies.
The TT itself has a huge impact on performance and sound. If the motor runs at inconsistant speeds it will sound terrible and If the motor or bearings are poor you will get rumble, wow, flutter. The build materials and design of the deck impacts the sound too - some people spend a fortune on 'upgrade' kits for decks (I'm really thinking of Thorens here) to improve the acoustic qualities of the already well performing TT's.
If the TT and tonearm aren't set-up properly this also has consequences to sound quality and record wear. If the headshell isn't aligned the channel separation will be poor.
The internal RIAA (if it has one) also makes a big difference as do many other internal components - quality and spec of capacitors for example.
This also doesn't take into account the amp used - I'm not going to get into expensive cables and snake oil things like that!
I'm sure lots more will come from other members.
Dave.