Is it? Do Fedora or Ubuntu provide an API like that?
Yes, GNU/Linux distributions provide exactly that.
Unless this is just a battle of semantics on the fact iptables/firewalld/ufw are user space apps.
Edit: and to clarify, you can have a user space app on Android to configure a firewall but they will either require root or a VPN-based solution like NetGuard.
https://selinuxproject.org/page/NetworkStatements
https://manpages.ubuntu.com/manpages/bionic/en/man5/apparmor...