I would buy a 2012 model under only three conditions: 1) it comes from an Apple Authorized Service Provider, 2) the history is known, and 3) it is a unibody non-retina model. Many Apple Authorized Service Providers sell used MacBook Pros, often from customers they know well and have sold Macs to for years, who eventually "trade up" to get a few hundred bucks off a new MBP. These individual shops have all the training and expertise of Apple, generally won't sell abused computers, and many will provide their own warranties on used devices. Should you need warranty work, you will be getting it done by someone certified by Apple, using Apple parts. As others have noted, parts availability for older models become more scarce with time, because, at a certain point, Apple stops making the parts. Consequently, if you plan to keep a 2012 for six years, you might want to purchase a spare logic board (and this would up the purchase price by a good $500-800 USD, potentially negating any savings you get.)
If you want the computer to last for six years, however, I agree with purchasing a new model, a new 2015 model, or a refurbished 2015 or 2016 model is the best decision, and that investing in AppleCare (giving you three years of extensive warranty coverage) is worthwhile. With the way the MacBook Pro retina is designed, if anything breaks, it is generally a massive repair bill (i.e., it could be a third to a half of the purchase price - again, quickly wiping away any savings with a used model, should it not be cared for and/or you have a problem outside of warranty.)
Also, for general usage, one low-cost option that could get you into a new Mac is the MacBook Air (in the States, many retailers have starting prices on these that are a little over half the price of a new 2016 MBP) - the downside is you don't get the retina screen. However, it's still a reasonably decent screen - the retina is just considerably nicer. It's got reasonably good processing power and SSD/RAM speed - again, not quite that of the MBP, but it's a new Mac & and a very well made computer for a very reasonable price.