That is because in ubuntu firefox is installed as snap by default, as for the flatpak version i do not know what happened. If you want firefox as a deb you need to add a ppa and then you can apt install firefox. There are lots of guides. All of these package managers can be confusing at times