Like cars, if you can but a quality used bike you will save a lot of money and in many cases get a better bike than you would at that same price point if you were buying new.
My previous commuter was a 1999 Trek 7500 hybrid which I picked up for $120.00 used and would have been a $450.00 - $500.00 bike new and although I upgraded and switched a number of parts it was never because anything failed save for one XTR rear derailleur that was also picked up used. Some of the parts I removed were traded / sold to fund the little upgrades and as I run a shop I can do things like build my own wheels and have good access to decently priced parts.
Because I was running some very nice hand built wheels and rare shifters this upped the value of the bike by about $500.00 but aside from these, the other parts I used to upgrade the bike were less than $150.00
After riding the bike 30,000 km I removed the expensive parts I was using and refitted the bike with some very decent replacements in the form of new wheels and different shifters and sold it to a friend for $350.00 as the bike was in better than new shape and much nicer than it was when it rolled out of the factory.
Shown with my custom wheels...