No it doesn't insert any rule like that by default though you could of course configure ufw to do so.
> 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.