I've kept both, and I think it really depends on the hamster and the handler. And of course, the species.
With Syrians in particular, it's generally accepted that males are better for a younger, inexperienced handler, particularly children, as males often tend to be more placid and amenable. There are exceptions of course, but the male is often a bit more relaxed, which makes them easier to tame.
Female, as we know, come in heat every four nights, thus they are often very hormonal. They are also far more territorial than males. So handling can very often take a little more time with females, and they should be handled regularly and gently from an early age. Providing that they are regularly handled, there shouldn't be a problem. In fact, I have often noticed that males, while more placid, tend to be a little more reclusive and shy, whilst a well-handled female, when tame, often has more personality, in a sense. She is more likely to
want to come out of the cage and be handled, and is often more curious and excitable.
When it comes to Dwarfs, there often isn't much of a difference when it comes to behaviour. I would only note that with Russian Dwarfs, particularly Winter whites, if keeping in a single sex colony or pair, female tend to be more likely to fight that the males. Brothers housed together tend to be a little more tolerant of each other.
So in my opinion I wouldn't ever choose a hamster because of what sex it is, because both have their charm. It just depends on you, the hamster itself, and what you hope to get out of that pet.