Ubuntu uses Snaps for a lot of the software, thus, when you write sudo apt install firefox that is actually an alias for "install firefox from snap". Snaps get installed locally, not on the system (globally, for all users), but as a user, so you really can't do much damage when you actually didn't do anything to the system in the first place.
Do sudo shit on any other distro that doesn't have a company behind it, see what happens.
Because if you have sudo, you have root. Side effect of being a server system, too. During install, if you specify a root password, sudo is not installed. If you don't, it is. Ubuntu just defaulted to the latter.
So that is why I always have to install sudo manually 🤦.
And I think older versions also left you at root, you had to define a user account manually. I think that's not the case now as I recall (I haven't installed Debian in a while).