Not on the same command line. As a command prior to running the homebrew installation script.
sudo -l (when typed alone as a command) shows you what sudo rights your account has. It should ask for your password (if you even know it - honestly, you shouldn’t for the ubuntu account that was put in by default)
if the NOPASSWD flag is set, it won’t even ask for your password. If you have no sudo rights, then you can’t install homebrew from that account.