No. But you can reset the passcode which will erase the iPhone and then restore the iPhone from a backup that you may have created on iCloud or on your computer. If you do not have a backup, then you will not be able to restore the data.
-----
I understand that you are referring to the passcode that is used to get to the Home Screen of your iPhone. You will have to reset the passcode to your iPhone by following the instructions in this guide published by Apple 👉 Reset the Passcode of your iPhone (Without a Computer). Note: All the data on your iPhone will be erased.
Hopefully, you have a backup created on 👉 iCloud and/or on a computer. If you do then, you can 👉 Restore your iPhone from the backup file once your passcode has been reset and the iPhone has been returned to factory settings by the procedure in the link above.
Axel F.