Hi,
Yes, you can add PHP inside your popups, but it requires the use of a plugin like Insert PHP that will allow you to do so.
However, in a best practices sense, it’s recommended you run your PHP through the use of shortcodes instead. Placing a shortcode directly into a popup will do the trick, and the Insert PHP Plugin should be used a last resort.
To get started writing a shortcode that executes your PHP, read this Shortcode API WP Codex.
Lastly, if you share with us exactly what you’re trying to accomplish, we may be able to come up with an even more elegant solution for you.
If you haven’t already, please do take a moment to click that Popup Maker Works and to rate and review the plugin to spread the love!