As an example, let's take the double negation elimination rule $$\neg \neg p\vdash p\ \ \ \text{and}\ \ \ p\vdash\neg \neg p$$
With this, we know that if $p$ is true, then $\neg\neg p$ is true, and vice versa. Now suppose we're given the formula $\phi(p)$, of which we are unaware if either of $p$ or $\phi(p)$ are true. By the double negation elimination rule, do we know if $\phi(p)$ is an equivalent statement to $\phi(\neg\neg p)$? That is to say, can we apply the transformation rule to $p$, even if it's nested within $\phi$?
In other words, does the transformation rule by itself allow us interchange any occurrence of $p$ with $\neg\neg p\ $, or can it only be applied when $p$ is on its own?