If you are signing in with your own Apple ID and Mountain Lion shows under your purchases as well as Yosemite available as a free upgrade/update, then you are good as you will be downloading that under your own Apple ID.
As long as that works, you should be fine although the previous owner most likely also did not remove the machine from here (although, once it is out of warranty, it is not that important, but if you do have a contact for the seller, ask him to do so as that will un-associate the machine from his Apple ID):
https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/classicLogin?appIdKey= 58ef9db8ff4d201409e7270a68e4408ae1678e1618204c476572a1b5e5fb3518&path&language=U S-EN
There is a process - and I would think that Apple used that on your machine - called internet recovery: you boot up with the Command + Option + R keys held down until you see a spinning globe; it takes +/- 15 minutes to be connected to Apple's servers. If you then use the Disk Utility in the Utilities screen to erase your drive, when finished you can reinstall the original OS (if Lion and later). That OS is not tied to an Apple ID until you first install/set it up with yours. That, by the way, is also the process you must use when selling the machine as it can be sold with the original OS, but any downloads from the app store (including the OS) are not transferable so they must be removed.
On a totally different note - you bought a mid 2012 - is that a retina model? If so, check this:
http://www.apple.com/support/macbookpro-videoissues/