Yes – after the hard drive is erased of all data, the operating system is reinstalled. That means that when you receive your refurbished iPhone or iPad, it will have a clean copy of iOS ready for you to set up. Or if you’ve purchased a refurbished MacBook, it’ll be ready for you with a clean copy of Mac OS X (or macOS in future versions).
Basically, the software is ready for you as it would be in a brand new model. You will be able to set your Apple device up as new, or possibly restore from a backup of your previous device.