A sum of squares cannot be factored over the real numbers.
However, we can factor over the complex numbers as you have mentioned it factors to (x-9i)(x+9i)
It turns out that a^2+b^2 factors to (a+bi)(a-bi).
We can prove this by expanding out the following:
(a+bi)(a-bi)
a(a-bi) + bi(a-bi)
a^2 - abi + abi - b^2*i^2
a^2 - b^2*(-1)
a^2 + b^2
Therefore, (a+bi)(a-bi) = a^2 + b^2 where i = sqrt(-1) which leads to i^2 = -1.