You haven’t mentioned which OS, but for Windows and most versions of Linux the answer is yes.
If installing Windows 8.1 or 10, where it tries to force you into using a Microsoft Account, just click on ‘skip this step’ and you can create a local account.
Been doing that a lot this weekend, preparing some Windows 10 VMs to archive. Almost done.
Another option (if you’re using Windows) is when it has finished installing and reboots, on booting windows for the first time you are presented with some options screens (setup an account, give MS to spy on you, rights of [I]Droit du seigneur[/I], agree to a set of terms & conditions that would teach even Satan’s demonic hordes a thing or two about contract law etc.). If you just shutdown the computer, when its new owner boots up, they will be presented with a virgin OS with the same first run options. The downside is that you can’t get into Windows fully to verify activation, drivers etc. (Although you could take a disk image, boot fully, check everything OK and then restore the image.)