The condition
$$\sum_{ 1 \leq i < j \leq n} a_ia_j \equiv 0 \pmod p$$
is equivalent to
$$\left(\sum_{ 1 \leq i\leq n} a_i\right)^2 \equiv n \pmod p.$$
So a necessary condition is that $n$ is a quadratic residue modulo $p$ (including the zero residue). If $n$ is divisible by $p$, then the above condition says that the sum of the $a_i$'s is divisible by $p$. Otherwise, the condition says that the sum of the $a_i$'s is congruent to one of the two square-roots of $n$ modulo $p$. Now it is easy to see that the sum of the $a_i$'s are equidistributed modulo $p$ (think about what happens when an $a_i=1$ is switched to $a_i=-1$), hence in the first case the probability is $1/p+o(1)$, in the second case it is $2/p+o(1)$, as $n$ tends to infinity.