For a prime $p$, $p$ divides $\sum_{i=1}^{p-1}i^k$ if and only if $p-1$ does not divide $k$.
For completeness, here is a one-line proof: if $k$ is divisible by $p-1$, then all $p-1$ terms are congruent to 1 modulo $p$. Otherwise we induct on $r:=k \pmod {p-1}$ summing up the identity $(x+1)^{r+1}-x^{r+1}=(r+1)x^r+...+1$ over $x=0,1,\ldots,p-1$.
Thus, for two primes you may simply suppose that $p_1<p_2$, then $p_1p_2-1\equiv p_1-1 \pmod{p_2-1}$ is not divisible by $p_2-1$.