Example 17 (20th Korean Mathematical Olympiad) Find all prime pairs $(p, q)$ such that $p q \mid \left(p^{p}+q^{q}+1\right)$.
Obviously, $p \neq q$.
Without loss of generality, assume $p<q$.
When $p=2$, by $q^{q}+5 \equiv 5 \equiv 0(\bmod q)$, we know that $q$ can only be 5.
Upon verification, we find that $(p, q)=(2,5)$ satisfies the condition.
When $p$ and $q$ are both odd primes, by $p^{p}+1 \equiv 0(\bmod q)$, we know that $q \mid\left(p^{p-1}-p^{p-2}+\cdots-p+1\right), p^{2 p} \equiv 1(\bmod q)$.
On the other hand, by Fermat's Little Theorem, we have $p^{q-1} \equiv 1(\bmod q)$.
If $\operatorname{gcd}(2 p, q-1)=2$, then $p^{2} \equiv 1(\bmod q)$, hence, $p \equiv 1(\bmod q)$ or $p \equiv-1(\bmod q)$. Therefore,
$0 \equiv p^{p-1}-p^{p-2}+\cdots-p+1 \equiv 1$ or $p(\bmod q)$, which is a contradiction.
If $\operatorname{gcd}(2 p, q-1)=2 p$, i.e., $q \equiv 1(\bmod p)$, then
$0 \equiv p^{p}+q^{q}+1 \equiv p^{p}+1+1 \equiv 2(\bmod p)$, which also leads to a contradiction.
Therefore, the only pairs of primes that satisfy the condition are $(2,5)$ and $(5,2)$.