This is possible in the XYZ WP Pop Premium plugin.
In the Display Logic Settings section, select the display trigger “On Exit”.
Then you can select whether you want to display the popup on first exit or every exit.
Now it will display the popup when anyone tries to leave the page.
Initially it will show the default browser confirm navigation popup with “Stay on this Page” and “Leave this Page” options. We can set the message for this default pop in the On Exit Trigger Message (see the 2 images).
The original popup will display only if the user “stay on the page”.