I'm guessing you mean the built in Disk Cleanup tool in Windows correct? If so then yes, it is safe.
Windows will find old updates and files in the prefetch that are no longer needed, and deletes them to save up room. As always, it is a good idea to backup any important information when going to a new build number in Windows 10. It rarely happens, but corrupted upgrades can happen.