Hi candelariaray,
Nokia has posted the following instructions for doing a factory reset at boot time, It should work for HTC and Samsung Windows Phone 8 devices in addition to Nokia Lumia devices.
Warning: This erases all personal content on your phone and restores the factory settings.
- Make sure the charger is disconnected, and switch the phone off.
- Press and hold the volume down key, and connect the charger. The screen shows an exclamation mark (!).
3. Press the keys in the following order: volume up, volume down, power,
and volume down. Your phone resets, and boots up. This may take several minutes.
For step #2, you can substitute plugging the charger, by pressing the power button for a few seconds, while pressing the volume downkey. You want to keep the volume down pressed
until the exclamation mark comes up on the screen.