I am trying to prove to myself why can substitution be used while using taylor expansion. for example: the taylor expansion of $e^{(x-3)^2}$ around $a=3$ and order of $6$ can be done by first evaluating $e^x$ and than plugging in $(x-3)^2$ getting $P_{6}(x)=1+(x-3)^2+\frac{(x-3)^4}{4}+\frac{(x-3)^6}{6}$
We know that $f(x)=P_{n}(x)+R_{n}(x)$ when $lim_{x\to a} \frac{R_n{x}}{(x-a)^n}=0$
So we first use taylor expansion around $a=0$ and of order $k=3$
So we in general we have $f(x)=P_{k}(x)+R_{k}(x)$ now we plug in $(x-3)^2$ and get $f(x)=P_{k*m}(x)+R_{k*m}(x)$ where $m=2$
Because we overall got a polynomial in the form of $f(x)=P_{n}(x)+R_{n}(x)$ the used substitution can be made? is that a valid proof?
This problem is related to series composition and what you did is almost perfectly correct.
Make a change of variable $(x-3)^2=y$ and use the fact that, around $y=0$ $$e^y=1+y+\frac{y^2}{2}+\frac{y^3}{6}+O\left(y^4\right)\tag 1$$ Now, you just need to replace $y$ by $(x-3)^2$ to get $$e^{(x-3)^2}=1+(x-3)^2+\frac{1}{2} (x-3)^4+\frac{1}{6} (x-3)^6++O\left((x-3)^{8}\right)$$
Take care : there is a typo in your formula ($\frac 14$ should be $\frac 12$).
The problem would have been different say for $e^{\sin(x)}$. You could start using $(1)$ and write $$e^{\sin(x)}=1+\sin(x)+\frac{\sin^2(x)}{2}+\frac{\sin^3(x)}{6}+O\left(\sin^4(x)\right)$$ and use $$\sin(x)=x-\frac{x^3}{6}+O\left(x^5\right)\tag 2$$ Replacing you would get $$e^{\sin(x)}=1+x+\frac{x^2}{2}-\frac{x^4}{8}+O\left(x^5\right)$$ The other way, would have been to write $$e^{\sin(x)}=e^{x-\frac{x^3}{6}+O\left(x^5\right)}$$ and use $y=x-\frac{x^3}{6}+O\left(x^5\right)$ in $(1)$. For sure, the result would be the same.