Edit: I misunderstood the question, here's I'll try to fix here. I don't have the complete answer but I'll try to give a counterexamplepartial answer: let $G=S_3$ the symmetric G$be a group , it has of order$6$|G|$ and has for each $d \mid |G|$ let $n_d$ indicate the number of elements of order $1$, d$in$2$G$; then if $|G|$ is even $|G| \nmid \sum_{d \mid |G|}n_d d$. Indeed we have that if $d$ is a odd divisor of $|G|$ (not equal to $1$) either $n_d=0$ or exists a odd prime numeber $p$ such that $p-1 \mid n_d$ and so $3$ n_d$is even, on the other hand if$d$is even clearly$n_d d$is also even and so$1+2+3=6=|S_3|$.\sum_{1 \ne d \mid |G|} n_d d$ must be even. Thus $\sum_{d \mid |G|}n_d d$ is odd and so $|G| \nmid \sum_{d \mid |G|} n_d d$, because by hypothesis $|G|$ is even.
No, here's a counterexample: let $G=S_3$ the symmetric group, it has order $6$ and has elements of order $1$, $2$ and $3$ so $1+2+3=6=|S_3|$.