"curl ... | sudo bash"
Running "sudo dpkg -i somepackage.deb" is literally just as dangerous.
You *will* want to run code written by others as root on your system at least once in your life. And you *will not* have the resources to audit it personally. You do it every day.
What matters is trusting the source of that code, not the method of distribution "curl ... | sudo bash" is as safe as anything else can be if the curl URL is TLS-protected.