You can turn off “erase all data after 10 failed passcode attempts” in Settings > Touch ID & Passcode (for iOS 12 at least, it may be in a different sub-menu on older OSes), and I don’t even think it’s enabled by default. This setting applies whether you have TouchID/FaceID enabled or not. Biometrics will force you back to password entry after 3-5 failed attempts anyway.
I should also note that for someone to maliciously trigger this functionality on their own, they would need a lot of patience and uncontrolled access to your device for over an hour, as the lockout timer increases exponentially for each failed attempt—it’s an hour long after the 9th attempt, and you’d need about half an hour to even get to that point in the first place.
I should also also note that, just like every other electronic device that houses data you care about, you should be backing it up so that a device loss or failure of any kind does not result in permanent data loss. You can still back up iOS devices to your local computer via iTunes if you’re paranoid about Apple’s cloud or have more data than will fit in iCloud’s paltry 5 GB of free storage.