I uninstalled BlueStacks as it was unused application, and it persists as a broken application and I can't delete it.
I've tried to
sudo rm -rf but it said operation not permitted.
Is there any way i can delete it cleanly?
You'll need to boot the Mac in Recovery Mode (hold Cmd + R when rebooting), open a Terminal and run the command below. This will allow you to remove the rest of the app.
rm -rf /Volumes/Macintosh\ HD/Library/StagedExtensions/Applications/BlueStacks.app
The reason is that when you install Bluestacks, you install not only the app itself, but also a kernel extension that is stored in /Library/StagedExtensions. You give specific permission to install that extension.
However, when it comes to uninstalling - as Bluestacks doesn't provider a full uninstaller - you'll have to do it manually. Unfortunately SIP protects the kernel extensions from alteration when booted in standard mode. By rebooting in Recovery Mode (or disabling SIP), you can delete the files.
If you need, you can follow a more thorough how-to on how to reboot in Recovery Mode and remove the kernel extension here: