How would you know how many HD a deity has?
It really is unsafe to assume a deity has 40 HD or less, a quick check on deities and demigods from 3.5 shows that a lot of deities had over 50 HD. Considering Paizo's (current) stance on never creating stats of real deities (demigods are fine), I don't think it's possible to claim if a deity has X number of HD.
Using James Jacobs (Paizo's Creative Director) words when describing the relative power between deities:
1) NASCENT DEITIES: We have things like nascent demon lords (like Treerazer) who can grant spells but are only CR 21 to CR 25. These guys are meant to fill the role of "let's kill an evil god as a capstone for this 1st to 20th level campaign" basically.
2) DEMIGODS: These guys are what mortals can (in theory) fight and defeat if the mortals are powerful and lucky enough. Demigods include things like demon lords, the Horsemen of the Apocalypse, and some regional deities like Achaekek (the mantis god) or Besmara (the pirate goddess). Whatever "CR" demigods end up at will occupy about the same niche as nascent deities do right now—+1 to +5 over whatever that ultimate, final level cap ends up being.
3) DEITIES: These are NOT things mortals can fight. They can oppose them, and given the right combination of legendary feats, they can even be defeated, but they won't ever have stat blocks. At least, not unless we decide to do a "Deity level ruleset" or something like that, but even then... I'm not keen on letting actual combat stats out for deities. The game would probably have to be completely different to accommodate that type of play experience.
Many demigods published by Paizo have HD among 30 and higher, like Kostchtchie (31 HD), Cthulhu (36 HD), Tawil at’Umr (35 HD), Pazuzu (35 HD), Nocticula (36 HD), etc. This means you could probably create a simulacrum of a demigod, but we don't know the difference in power between a demigod and a true god.
Others, by other publishers (thirdy-party)), have even higher HD, like Orcus (45 HD) from Tome of Horrors.
There are deities that their spawn, which have little to no divine power, already have more HD than demigods, like the Spawn of Rovagug, The Firebleeder.
Researching a god's HD
The spell Soul Bind clarifies that it's possible to research an individual HD, though the term does not exist outside of the game system, so you would have to research something like "how strong my god is" or something like that.
The rules for researching (originally from Mummy Mask AP, later republished on Ultimate Intrigue) would allow you to figure this out, but finding out a library that contains this information would be as difficult as the GM decides for it to be, going from simply "oh, the local library might know" to as complex as "well, you would have to become a deity yourself and ask the god of knowledge" (on golarion, either Nethys or Irori would know).
The option of asking the Akashic Record (from Occult Adventures) also exists, but the kind of answers available are also under the control of your GM. Ultimately, the DC necessary to find out any information about a god will depend on what HD the GM decides that a god has, since there is no official information on that yet.
According to this other post from James Jacobs, a god can die (see Aroden), but we are expecting a creature of CR around 50 or more.
Just because we've never statted up a CR 50 creature doesn't mean you can't do so!
While there is no direct relation between CR and HD, if I had to guess we are looking at a creature of HD 50-60 or even higher, as HD are usually a little higher than a creature's CR.
Increasing Simulacrum HD limit
It is also possible to increase your caster level, and thus, the HD limit on the spell, potentially going over 40 HD. For instance, the following traits, feats, spells and magic items could all be combined and allow your character to obtain a caster level of 28 on the proper conditions:
- Death Knell spell: temporary +1 CL. Possible if a helper uses a Sacrificial Dagger.
- Gifted Adept trait: +1 CL on 1 spell;
- Outlander trait (Loreseeker or missionary): +1 CL on 3 spells;
- Moon Circlet: situational +/- 1 or +2 CL depending on the moon;
- Arcane Beacon from arcane cleric domain: +1 CL for arcane spells. This becomes available to wizards that take the Believer's Boon feat;
- Orange Prism Ioun Stone:: +1 CL;
- Varisian Tattoo: It has a prerequisite of Spell Focus in the appropriate school, upping the DC +1 for every spell in that school cast and upping your CL +1 in spells from that school. Divination is the only restricted school.
This potentially raises the HD limit to 56, but if that is enough to make Simulacrum affect your deity is up to your GM. Do note that this value is nearly twice the HD of some known demigods.
Divine Heralds
Most deities have their own Divine Heralds, which do have stat blocks and could become targets of simulacrum, as most are 18 HD (with one exception). But considering you are a 20 level caster, you might consider conjuring the herald instead using Greater Planar Ally (their HD are just right for the spell).
If Paizo ever decides to create stat blocks for deities, then using simulacrum to create a copy of a god surely will become possible. But until then, that is entirely GM Fiat.