It depends on the trailer... the pricier ones will be better off road as they have decent suspension and a suspended seat, they’ll also be more robust and lighter weight.
Decent brands are Burley, Thule and Croozer. They all sell well/ don’t lose too much value second hand on eBay/ Facebook etc.
There’s lots of good advice on Two Wheeling Tots about trailers.
I’ve been towing DS pretty much weekly since 5 months (he’s now 3 and a half). We normally ride for 2 - 4 hours (with park, cafe, run about stops). I’d planned to do a lot of cycling with him so it was worth splashing out on the best trailer I could afford.
He certainly doesn’t have any neck issues to suggest he’s had whiplash!!
I opted for a trailer over a seat as it shelters DS from strong sunshine and awful weather better. I’d also planned on doing long rides so presumed a trailer would be more comfy for naps and accommodate, drinks, snacks and toys (it’s got pockets each side of his seat). There’s a big cargo area behind his seat which is ace for his balance bike and a picnic.
I have a Burley Solo - I picked it because it was light (obviously the heavier the trailer the harder it is to tow), packed easily/ compactly (I store it in my car boot) and was suitable for on and off road. It’s been amazing. I would really recommend it - it’s covered about 5,000 miles and other than the cover being faded is still in great condition, testament to build quality and robustness.
It handles like a dream - I’ve been down some big mountain road passes round hairpins at speed and it corners really well. It also tows really well off road (rooty, Rocky, trails) - it has three levels of suspension which you adjust as the child grows. I’ve never even come close to rolling it.
You’ll have to bear in mind the hitch compatibility with your bike. The better trailers attach to the rear axle or quick release. I tow on a standard road bike, the hitch attaches to the quick release. I also tow on a 29”er with disk brakes - I had to get a special thru axle adapter to accommodate the hitch.
You’ll also need to potentially consider the existing gear ratios on your bike. I live in a really hilly part of the UK, so on my road bike I swapped my 11-28 for an 11-34 (i fitted a road link to accommodate this on a standard rear mech). I could just about manage the steeper climbs on the 28 initially, but because of the amount of power I needed to put down it’d cause the back wheel to lose traction. There’s not a chance I’d cope without the 34 now he weighs 16kg. Gearing is also something you’d need to consider for off road riding, although not an issue if you’ll be using a mountain bike.
If you are confident road riding yourself and have reasonably quiet lanes nearby I wouldn’t be put off by it. We do a large amount on road and it’s fine.
Happy peddling.