You don’t need to have Apple ID to reset a MacBook to factory defaults unless it’s equipped with an Apple Silicon or T2 Security chip. If the T2 or M1-equipped computer turns on Find My app and Activation Lock will be enabled at the same time. You need your Apple account before anyone can turn off Find My, clean or reactivate your Mac. Therefore, if you want to restore your MacBook Pro (either with a T2 or M1) to factory settings, it’s impossible to do that without Apple ID. However, you can retrieve it or request access to it previously signed in this computer from Apple Support. Then wipe the data and settings of the Mac and reinstall macOS.