The geometry of the bike has everything to do with stability but I've never met a bike that
can't be ridden no hands. It's a lot easier on some bikes than others. Every bike is a little different. Any time I get on a bike I haven't ridden for a while, it takes a while before I can ride it no hands with confidence. Back in the old days, I could ride some of the baloon tire bikes no hands all day long - up hill, down hill, fast, slow - those bikes were incredibly stable - honestly, I don't know how anybody ever fell off one of those things.
A wheel that's not true, or a bike that doesn't track properly can mess you up, but all bikes are designed to be naturally stable. If they weren't, they'd be nightmarish to ride even with your hands on the handlebars.
It's relaxing sometimes to ride no hands, but I never do it in traffic. The worst accident I ever had (many years ago) happened because I was showing off my no hands skills. Evidently I didn't have quite as much skill as I thought I had.

I was in the hospital less than a week but, obviously, I lived.