Is there any way to put a password to avoid someone from hard resetting my phone?
No. Even if you could add such a restriction within Android, it would still be possible for an attacker to boot into recovery or into fastboot mode and reset the phone from there.



If you're trying to protect the confidentiality of your data (i.e. stop an attacker accessing it), then encrypting the phone is what's required for that. If you're trying to protect the integrity of your data (i.e. stop an attacker deleting it), then you can do that by backing it up to a secure location that there's no risk of losing.

If you're trying to stop someone deleting a tracking program or the like, then you're not protecting your data at all, you're trying to protect the phone itself. You can only do this with physical precautions, not software precautions, or by insuring against the loss.