For which primes $p$ can one always find $q$ such that $X^2+(pq-1)Y^2 \equiv 0\!\pmod{p^2}$ has no solution? For which primes $p$ can one always find an integer $q$ such that the congruence
$$X^2+(pq-1)Y^2 \equiv 0\!\pmod{p^2}$$
has no solution for co-prime integers $x,y$?

For $p=q$, we always have a solution $X=Y=1$.
Consider $p\neq q$. We will look at solutions with $X=Y+p$. We then have
$$X^2+(pq-1)Y^2=Y^2+2Yp+p^2+pqY^2-Y^2\equiv pY(2+qY)\pmod{p^2}.$$
Since $p\neq q$, we can solve $2+qY\pmod p$, and then $Y\not\equiv 0\pmod p$ unless $p=2$. Such $Y$ and $X=Y+p$ will solve your congruence. So for $p\neq 2$ there is no $q$ you seek for.
For $p=2$, we can take $q=3$, since then $X^2+(pq-1)Y^2\equiv X^2+Y^2\pmod 4$, and it's easy to see this is $0\pmod 4$ iff both $X,Y$ are even.
