I want to by a used MacBook Pro i5 Mid 2010 edition, but there is no system DVD. The previous owner's stuff is on the hard drive, and I want to wipe it clean with a new OS. Can I boot into existing Mac OS and download an ISO of the latest Mac OS X or do I have to buy a install disk from Apple?
If it's running Mac OS X 10.5.8 "Leopard" or earlier, then you must buy a Snow Leopard Install DVD from Apple (or barrow it from a fiend). You could also buy Lion , but it's the same price, $20 USD. Though, Snow Leopard comes through the mail and Lion is sent as a verification code through email.
If it's running Mac OS X 10.6 "Snow Leopard" to Mac OS X 10.6.7 "Snow Leopard", then you will need to do an Apple Software Update, to update it to 10.6.8. Click the Apple logo in the top left of the desktop, then select Software Update.
If it's running OS X 10.6.8 "Snow Leopard", then you will have to update it through the Mac App Store. OS X 10.10 "Yosemite" runs amazingly on my 2009 MacBook Pro, so I'd strongly recommend updating to Yosemite (for free) no matter what you do, don't let anyone tell you it doesn't run well on older hardware, it's fine.
If it's currently running OS X 10.7 "Lion" or later, then yes. Just boot into Recovery Mode by holding the Option key down at startup. Two images of hard drives will appear, use the arrow keys to select Recovery, press the Enter key to make your selection. Once in Recovery, select Disk Utility and select the hard drive. Then select Erase from the bar and select Erase in the bottom right. After its erased, go back to the main window in Recovery and select Reinstall OS X, then just follow the onscreen instructions. Make sure to update to Yosemite using the Mac App Store afterwards.
Hold down Option/Alt key when booting, this should get you into the boot menu.
If you can see a recovery boot option, you can format the HDD partition using Disk Utility in that and use the same software to do a fresh install.
It will download the latest version of whatever OS X release the computer currently runs.