I think they were saying if one uses such a rule in general (as is normal) but looking into it some more it seems it may actually be the default out of the box as well as long as you've enabled UFW:
> On installation, ufw is disabled with a default incoming policy of deny, a default forward policy of deny, and a default outgoing policy of allow, with stateful tracking for NEW connections for incoming and forwarded connections.
https://manpages.ubuntu.com/manpages/noble/man8/ufw.8.html
The more specific rule is probably more useful if you do intend to expose a TCP port though.