Apple is being very sneaky!! To help push people to the newer OS's they have a time bomb in the OS installer. So if you try installing an older OS release when a newer one is out you need to back wind the date to the year the OS was introduced
You'll need to check your date setting within Prefs. Are you using Apples Time server or manually setting it? You'll get the error like this if the date is incorrect (month & year). Here we want the year for Sierra to be last year (2016). Manually set it and then reboot your system. Double check the date is now manually set (make a new folder and check its creation date)
In the case of El Capitan you need to manually back wind the year to 2013 as the installer has an end date which will give this error.
You also may want to replace the HD SATA cable as this series had issues with it. This is important if you've upgraded the drive to a SSD. Here is the IFIXIT guide you'll need to follow: MacBook Pro 15" Unibody Late 2011 Hard Drive/IR Sensor Cable Replacement and you'll want this newer version of the part: MacBook Pro 15" Unibody (Mid 2012) Hard Drive Cable - Apple P/N 923-0084. Yes! This is the part you want! The older part is not as well engineered.
Two more points you'll want to place some electrical tape on the upper case where the cable crosses as the cable tends to abrade against the rough aluminum. You also want to make sure the black plastic bottom cover clip as seen here marked in Blue is not damaged, if it is you'll need to move the other one over: