A result of this nature is called a spliting lemma and you've shown it is true for abelian groups. It is not true in general, and here is an example that can be found on that page spelled out a bit (which is the simplest example): take the map $S_3 \rightarrow \mathbb{Z}/2\mathbb{Z}$ given by the sign of a permutation. Then the kernel is $A_3$ and the image is $\mathbb{Z}/2\mathbb{Z}$. It is not true that $S_3=A_3\times \mathbb{Z}/2\mathbb{Z}$, which can be shown in many ways, but one is to note that $\{e\}\times \mathbb{Z}/2\mathbb{Z}$ is normal in $A_3\times \mathbb{Z}/2\mathbb{Z}$ but $S_3$ has no normal subgroup isomorphic to $\mathbb{Z}/2\mathbb{Z}$.
The answer to you main question is: $G$ has property (P) if and only if all the $q_i$'s are equal. This is not too hard to see. If all the $q_i$'s are equal, then all subgroups that are isomorphic are actually conjugate under the automorphism group of $G$. Conversely, if not all of them are equal, you can find two subgroups of order $p$ with non-isomorphic quotients (in the obvious way, by taking them from factors of different orders).
For your second question, I think the answer is the same for every $d$, assuming it's a non-trivial divisor ($1<d<|G|$). I don't have all the details worked out but, basically, you can more or less ignore $p$ and encode your group $G$ by the list of $q_i$'s.
For example, $G$ could be the group $(1,2,3)$ and $(1,1,0)$ and $(0,1,1)$ would represent two isomorphic subgroups, with quotients $(0,1,3)$ and $(1,1,2)$, so non-isomorphic.
Now, it suffices to show that, unless you have the constant sequence, for every non-trivial sum $s$, you can always find two dominated sequences of sum $s$ which are permutations of each other, such that the difference with the original sequence are not permutations of each other.
This is essentially a combinatorics problem and I think it's true, but there is a little work to be done.
EDIT: As was pointed out in the comments, I was assuming that $G$ is a $p$-group, for some reason. But note that the general problem is easily reduced to that case: (abelian) $G$ has this property if and only if all its Sylow $p$-subgroups have this property.
Best Answer
You say $k_1h_1\in KH=HK$ so $k_1h_1\in HK$ therefore $k_1\in H$, your argument implies that $K\subset H$ since $k_1$ maybe any element of $K$ and this is not always true.
This is a proof:
$h\in H, k\in K, [h,k]=hkh^{-1}k^{-1}=(hkh^{-1})k^{-1}$ since $K$ is normal $hkh^{-1}\in K$ and $[h,k]\in K, [h,k]=h(kh^{-1}k^{-1})$ since $H$ is normal, $kh^{-1}k^{-1}\in H$ and $[h,k]\in H$, we deduce that $[h,k]\in K\cap H=\{1\}$ and $kh=hk$.
$h_1,h_2\in H, k_1,k_2\in K, h_1k_1h_2k_2=h_1(k_1h_2)k_2$ since $k_1h_2=h_2k_1$ we deduce that $h_1k_1h_2k_2=h_1h_2k_1k_2$ Since $H$ and $K$ are commutative, we deduce that $h_1k_1h_2k_2=h_2h_1k_2k_1=h_2k_2h_1k_1$ since $h_1k_2=k_2h_1$.