Consider two gears at a centre distance D. The two gears touch on their pitch circles, so for 1:1 ratio, each pitch circle has has a radius of D/2 or 1/2 * D. That means each gear has a pitch circle diameter of D.
The total (sum) of the pitch circle diameters is 2D and the gears share this 2D in proportion to their ratio (i.e. 1 * D each for 1:1 ratio).
Now, for 1:2 ratio, one pitch circle will have radius D/3 (or 1/3 * D) and the other 2D/3 (or 2/3 * D). The corresponding pitch circle diameters will be 2D/3 and 4D/3.
Again, the sum of the pitch circle diameters is 2D and the gears share this in proportion to their ratio (i.e. 1/3 * 2D for one and 2/3 * 2D for the other).
Let us try a 13:27 ratio. One gear will have a PCD of 13/40 * 2D and the other a PCD of 27/40 * 2D, the sum of the PCD's again being 2D.
So the general rule is to take twice the centre distance and pro-rata it according to the gear ratio.
This gives you the PCD of each gear that will fit in the space and achieve the ratio you want. These two numbers are inviolate.
You then choose a tooth count and calculate a DP/MOD for this count or you choose a DP/MOD and calculate the number of teeth.
For any given space and given ratio, you can use big gears with few teeth or small gears with lots of teeth.