So in such countries the movements with banned apps should post step by step guides for their followers of how they can enable sideloading and install the banned app.
On iPhone you have to root your phone for sideloading, so that is a closed system for the average user, but on Android there is an option for that, so no rooting is required:
https://www.howtogeek.com/313433/how-to-sideload-apps-on-and...
If anything, Google and Apple have more leverage than F-Droid or similar because Pakistan can't block them without significant backlash, and needs their cooperation, which is at least debated ( point in case, the article says a few of the apps weren't blocked by Google).
And furthermore, anyone can install any apk or app store serving apks on Android devices.
If users could load any apps they want outside of the google and apple stores there would be many gates that countries like Pakistan would need to close. Not only more gates but new gates opening every day. Basically, it would be the old internet model, which is very difficult to control.
If your app requires some sort of background functionality (it is a messenger, or anything) you would have to run through some ugly hoops to keep it running, or you have to rely on push notifications. And push notifications are not available for sideloaded apps.