Dry is okay, but it’s not ideal. You have to be careful, you can’t go full on. It’s more of a tease than a real HJ when you do it dry. If you start really rubbing up and down and gripping him tightly, it chafes, it can hurt, and it might tear their skin, so the easiest thing is always to use spit. Spit in your hand, spit on his dick, whatever. If you don’t want to do that, keep lube nearby. You can spit a couple times and then his precum will start leaking and you can use that – spread it out.
The only other thing that would influence this is whether or not he’s circumcised. Cut, yes they need some kind of wetness, uncut, it’s actually much easier to give a dry handjob without it being painful because the foreskin slides up and down naturally.