NIZK proof for randomization of DLOG
Yes $P_2$ can generate $\pi' \gets (\{ \exists r' \mid X' = X^{r'} \}, r)$, which proves that he knows $r$ that is the Dlog of $X'$. Since $r$ is chosen by him and $X$ is public, he can do this just as any normal DLOG proofs.

However, $P_2$ cannot generate $\pi'' \gets (\{ \exists xr' \mid X' = g^{xr'} \}, xr)$, which I guess is what you actually want. This would require $P_2$ to know $xr$, instead of just $r$.