Numbers in a list change after each delete. Repeating the rule you wrote is more predictable.
sudo ufw allow 80/tcp
sudo ufw delete allow 80/tcp
Put delete in front of the exact rule you added and ufw removes the matching one, for both IPv4 and IPv6. This is easy to use in a script, where there is no way to read a number from the list. The text must match the original rule: allow 80 and allow 80/tcp are separate entries. Run ufw status afterwards to confirm that nothing similar remains.
Further reading: ufw manual page