I was waiting for a referance to those services.
Several distributions have, for various reasons, introduced a daemon for managing the iptables ruleset.
ufw is the "uncomplicated firewall" in Ubuntu; it's quite easy to manage and generates a very much non-uncomplicated iptables ruleset.
Then there is
firewalld in Fedora, which up until quite recently used what was possibly the most ham-fisted approach imaginable to manage firewall rules, and was unable to reload the ruleset without breaking every existing connection.
I don't know what happens if you "stop" (that is, send a SIGTERM to) these daemons. Perhaps they clean up by flushing the ruleset before they exit. Perhaps they do nothing at all and leave the ruleset intact. You'll have to read the documentation for the service in question to find out.
In any case, such daemons are distribution-specific and only act as an abstraction layer on top of the real firewall, iptables. Flushing the ruleset with a script containing the commands you listed will work on
any distribution (although one should probably kill off any "firewall" daemons first to prevent them from partially or fully reloading the ruleset).