Unfortunately, it cannot. The only way to remove Pegasus spyware from your phone is to stop using it and make sure the new phone apps are all updated.