Komoot and Strava are both able to tell this, Strava you just tell it “prefer dirt surfaces”.
In the UK they both work relatively well if you can pick a-b and even better if you know/pick a few points along the route that you know are good. I find Strava works significantly less well than komoot for “pick me a 120k circular gravel route”, but perhaps better for a get me from a-b.
They seem to achieve the routing totally different ways though. Komoot appears to have a better routing algorithm, it uses “highlights” which are places or segments along the ride that humans have said “I like this, it’s noteable” or where there is photos of a section (probably a good proxy for someone enjoying the ride). Strava however has 10+ years of historic ride data and have used that to generate a heat map which means you won’t get totally stitched up with a route going down paths that require walking.
This all changes outside the uk. In Australia for example komoot is barely heard of, the routing is a bit rubbish and the risk of a 10k hike a bike on rough and unrideable track means the value of Strava heat-map routing is higher.
Basically either will work.
HTH