I've seen Selenium come up here on Slack (and a similar use case using Playwright instead of Selenium), and the issues people encountered were related to Selenium, not Prefect.
In one case, neither Selenium not Playwright worked properly when the user tried to use a headless browser in the environment where they ran their Prefect agent because the site the were trying to scrape treated headless browsers as bots.
In general I expect Selenium will work inside a Prefect task, though.