Scroll to the bottom if you're after a simple list of matchups.
So that we're on the same page, I'll establish the basic ideas of compatibility right away, in case there is any ambiguity: Pokemon are compatible if they share an Egg Group and are of opposite genders. Exceptions are Pokemon in the Undiscovered Egg Group, who can never breed, and Ditto who can breed regardless of gender and Egg Group, unless its partner is from the Undiscovered group. As for how this relates to Nidoran-M, Nidoran-F and their evolution lines, note they are not necessarily exceptions to these rules, so if you stick by them things will make sense eventually; they are however, anomalies within the system that can definitely confuse you. I will try my best to explain this in simple terms, but there may not be any easy way to outline this particular mechanic.
The first hurdle here is understanding which Pokemon in the Nidoran families can actually breed in the first place. Unfortunately this is where the first layer of complexity is met, so bear with me here: Nidoran-F, Nidoran-M, Nidorino and Nidoking are all in the Monster and Field groups and can therefore breed, but Nidorina and Nidoqueen are in Undiscovered and this cannot breed ever. This is where things are strange: Nidorina and Nidoqueen are unable to breed for seemingly no reason, and additionally, Nidoran-F can breed thus differentiating it from the others in its evolution line. If you can get your head around that, things start to make sense a lot quicker.
The main other mechanic to understand is the possibility that Nidoran of either gender will produce offspring that is not of the same gender. Gender dictates how much this affects the breeding matchup: since Nidoran-F is female, it will pass down the species, meaning this mechanic affects any breeding matchup it can possibly have. However, since Nidoran-M is male, the only time it passes the species is when it breeds with Ditto, so it isn't of concern otherwise. However, Nidoran-M is only subject to this mechanic as of Gen 5; it won't produce Nidoran-F eggs in Gen 4 or earlier. Evolved forms of the Pokemon are not subject to this mechanic; Nidorino and Nidoking breed as any other Pokemon would and Nidorina and Nidoqueen can't breed at all.
Based on all of this, if you want to guarantee a Nidoran-M egg, then breed Nidorino or Nidoking with anything compatible than isn't Nidoran-F and you'll get Nidoran-M every time. However you cannot guarantee a Nidoran-F egg, as it is female and therefore responsible for passing down the species 100% of the time. Hopefully that makes sense, let me know if there's anything you're still wondering about. Below is a list of all the breeding matches that is helpful as an immediate reference. A list of matchups within the Nidoran family only, as well as Ditto, is linked here via pastebin also.
- Nidoran-F + anything compatible = Nidoran-F or Nidoran-M
- Nidorina + anything = not compatible
- Nidoqueen + anything = not compatible
- Nidoran-M + Ditto = Nidoran-F (Gen 5+) or Nidoran-M
- Nidoran-M + anything not Ditto and compatible = refer to female
- Nidorino + anything compatible = refer to female
- Nidoking + anything compatible = refer to female