Let $f:[-a,a] \rightarrow \mathbb{R}$ be a function assuming derivatives up to the $n$-th order in the open interval $(-a,a)$. The Taylor polynomial of $f$ around $0$ is:
$$P_{n}(x) = \sum_{k=0}^{n} \frac{f^{(k)}(0)}{k!}x^k$$
For example, if $f(t)=e^t$, then:
$$P_{n}(t) = 1 + t + \frac{t^2}{2} + \frac{t^3}{3!} + ... + \frac{t^n}{n!}$$
It's possible to substitute $t \rightarrow -x^2$ to get:
$$P_{n}(-x^2) = 1 - x^2 + \frac{x^4}{2} - \frac{x^6}{3!} + ... + (-1)^n \frac{x^{2n}}{n!}$$
And the primitive of this polynomial could be used to approximate $\int e^{-x^2}dx$
However, if we had $g(x) = e^{\sin x}$, the third order Taylor polynomial would be
$$P_{3}(\sin x) = 1 + x + \frac{x^2}{2}$$ (Note: the third derivative calculated in $0$ is equal to $0$)
And obviously, replacing $t$ by $\sin x$ wouldn't work here.
It may sound a silly question, but when I got to this result I started asking what's formally a substitution and when it's possible to change variables and when it's not.