how to not allow an app to be installed if another app is not available or yet installed in frappe
You can set the required_apps
in your custom app to run a validation on install.
For example, the India Compliance app requires both Frappe and ERPNext to be installed: