This question didn't specify which game it was asking about, or whether it was asking about singleplayer or competitive. Normally I would hide such vague questions, but hiding this specific question risks losing search engine hits. I guess I'll have to answer it for the most common use cases in order to appease the Algorithm.
RBY speedrunning
NidoranM notably learns the 65 base power horn attack at level 8, which is a very strong move at this point in the game and certainly stronger than NidoranF's scratch. This makes NidoranM much easier to use and level up in the very early game before it evolves and gets better stats. Nidoking also has higher attack and speed, which means it is a bit more likely to outspeed an opponent or save an X attack. If you're playing more casually, the difference between them is much more negligible, and both are more powerful than almost all of your other options.
source
Gen 2 OU
Both can learn moves that are super effective against literally more than 50% of the metagame, and both can learn lovely kiss. However, Nidoking is better at taking advantage of weaknesses and sleep turns because of its higher physical attack.
source
Gen 4 OU
Although Nidoqueen is sometimes outclassed by Roserade as a toxic spikes user, its better defensive stats and typing, sandstorm immunity, and stealth rock sometimes give it more turns to set up its entry hazards. It's also better at checking a few specific threats that Roserade can't, like Infernape or Lucario. Nidoking, on the other hand, is almost completely outclassed by stuff like Flygon and Gliscor as an offensive ground and outclassed by Nidoqueen as a toxic spikes user.
source
Gen 6 OU
Nidoking was brought back to relevance by 2 things: sheer force and Clefable. (of course it's still useful against a few other threats, like Heatran or Landorus) Because it's best as a wallbreaker in this generation, it wants as much special attack and speed as possible, and it has more of that than Nidoqueen. In case you're wondering, toxic spikes is less relevant in gen 8 because Cofagrigus outclasses both as a toxic spikes user.
source
Gen 8 OU
As the decades pass, change happens more and more slowly because why improve your game design when most of your revenue is from selling plushies? Nidoking is still a viable wallbreaker, and it runs the exact same earth power/sludge wave/ice beam/flamethrower/252 SpA/252 Spe/timid set that it ran 2 generations ago. The only difference is that both are outclassed by Toxapex instead of Cofagrigus as toxic spikes users.
source
tldr Neither of these Pokemon are good in OU in odd numbered generations.