Yes! After the hard drive is erased of all data, Apple products have their operating system reinstalled.
A refurbished Apple product's software is ready for use, as it would be in a brand new model. You will be able to set up your Apple device as new or restore your settings from a backup of your previous device.
When you receive your refurbished iPhone or iPad, it will have a clean copy of iOS ready for you to set up. If you’ve purchased a refurbished MacBook, it’ll be ready for you with a clean copy of Mac OS X or macOS depending on the device.