You can factory reset an iPhone using Recovery Mode even if you don't have an Apple ID or Password. Ensure the latest iTunes version is downloaded on a device you trust.