Yes, erasing your iPhone remotely is safe, but make sure you have a backup of your data before doing so.