I claim the only such pair is $(p,n)=(17,1)$.
First, suppose $p=2$. Then
\[
17^n \cdot 2^{n^2} - 2 =(2^{n^2+3}+2^{n^2}-1) \cdot n^2
\]Clearly, $n$ is even. But, then $4\mid {\rm RHS}$, whereas $v_2({\rm LHS}) = 2$, a contradiction. Hence, assume $p>2$. In this case, $n$ is odd, and therefore $n^2\equiv 1\pmod{8}$. We now inspect both sides modulo $17$. Note that
\[
2^{n^2+3}\equiv -1\pmod{17}\qquad\text{and}\qquad 2^{n^2}\equiv 2\pmod{17},
\]and thus $17\mid {\rm RHS}$. Consequently, $p=17$. For $p=17$, we arrive at
\[
17\cdot \left(17^{n-1}\cdot 2^{n^2}-1\right) = \left(2^{n^2+3}+2^{n^2}-1\right) \cdot n^2
\]Now, it is seen easily that for $n\ge 3$, $17^{n-1}>9n^2$. Hence, for $n\ge 3$,
\[
17^{n-1}\cdot 2^{n^2}-1 > 9n^2\cdot 2^{n^2}-1\implies {\rm LHS}>17\cdot (9n^2\cdot 2^{n^2}-1).
\]On the other hand,
\[
{\rm RHS} = n^2\cdot \left(9\cdot 2^{n^2}-1\right) = 9n^2 \cdot 2^{n^2}-n^2<17\cdot \left(9n^2\cdot 2^{n^2}-1\right).
\]A contradiction for $n\ge 3$. As $n$ was odd, we then conclude $(p,n)=(17,1)$ to be the only possibility.