Can a plugin deactivate and delete itself once installed and activated?

You can deactivate it with:

deactivate_plugins( basename( __FILE__ ) );

I don’t think you can delete it. It would be a big security risk, IMO. But if the folder has the correct (but insecure) permissions, you could use the PHP function rmdir

tech