This is impossible.
The message basically means that the program attempts to perform an administrative task and failed, thus needs administrative privileges. This can include writing to a location your user does not have write privileges to, but it can be more. What this is, can’t be checked on beforehand.
You can create a shielded environment and run the app then and monitor what it changes, but at that point you are already doing exactly that what you wanted to prevent, so technically its not possible.
Although a software installation will always do the same thing, programs can also require administrative privileges when run and they can do different things depending on what actions you do.
The best thing you can do if safety is really a concern, is to use good uninstall software. Some of them come with an install monitor program to register all changes and log those to a logfile. IOBit uninstaller is such program, but there are others that can do this too.
An example of where this “Do you want this app to make changes to your device” can make a difference.
TeamViewer Quick Support will ask this question when you start it. If you click yes, the program is run as administrator. If you click no, the program is run as user.
If someone then remotes into your computer, depending whether you clicked yes or no, they will be able to do everything or are limited. When TeamViewer is not run as administrator, it cannot access the administrative runtime at all, meaning that when the remote user connects and wants to start another program as administrator, they hear the prompt sound, but can’t actually see the dialog nor interact with it. If the local user then clicks yes, they can see the dialog that comes after it, but cannot interact with it in any way.
If yes was clicked, they can see and do all that.
In this case, the program TeamViewer does not actually write to a file or registry at all.