Safe? Yes, unless you have to unlock the bootloader, which generally deletes all user data.
Will it work? Depends on the system and where the "deleted" data is. In versions of Linux, deleted means really truly and irreversibly deleted. But not all programs delete data immediately.