Depends on your own definition of "sound quality." Purists would not put up with anything less than an external DAC+headphone Amp on their headphones.
Can you do it? Sure, just have to make the proper wirings. Some Mobo are wired in such a way when you plug in the headphones, your speakers automatically disables, but that should not deter anybody with a soldering iron and know how to use it.