Let's look at what you base $9$ number actually means. $$813_9=8\cdot 9^2+1\cdot 9^1+3\cdot 9^0$$
If we wish to write this as powers of $3$ with coefficients between $0$ and $2$, we can simply do
\begin{align}
3\cdot 9^0&=1\cdot 3^1+0\cdot 3^0\\
1\cdot 9^1&=0\cdot 3^3+1\cdot 3^2\\
8\cdot 9^2&=2\cdot 3^5+2\cdot 3^4\\
\end{align}
Why can we do this?
Why can we write $$a_n\cdot 9^n=b_{2n+1}\cdot 3^{2n+1}+b_{2n}\cdot3^{2n}$$
First note that $9^n3^2n$, so when dividing the equation by that, we get
$$\frac{a_n\cdot 9^n}{3^{2n}}=a_n=3b_{2n+1}+b_{2n}=\frac{b_{2n+1}\cdot 3^{2n+1}+b_{2n}\cdot3^{2n}}{3^2n}$$
So actually, the problem comes down to writing a number $0\leq a_n<9$ as $3b_{2n+1}+b_{2n}$, where $0\leq b_{2n},b{2n+1}<3$. This is obviously possible.
Why does this work for binary and hexadecimal?
Actually, the answer is fairly similar. The problem can be reduced equivalently, resulting in the equation $$a_n=8a_{4n+3}+4a_{4n+2}+2a_{4n+1}+a_{4n}$$ Where $0\leq a_n<16$ and $0\leq a_{2n+3},a_{2n+2},a_{2n+1},a_{2n}<2$. The solvability of this equation is in my opinion a little less obvious, but still quite understandable; But, for the sake of a more thourough understanding, we could look at hexadecimal-octagonal conversion. This comes down to the easy equation $a_n=2b_{2n+1}+b_{2n}$, where $0\leq a_n<16$ and $0\leq b_{2n+1},b_{2n}<8$. This is cleary solvable. Doing this for octagonal-base 4 conversion and base 4-binary conversion shows with a recurrance-like approach that this indeed works for hexadecimal-binary conversion.
Hope this helped!