The statement ##t^2=x## is saying that the expressions (strings of text) ##t^2## and ##x## represent the same number. So yes, you can certainly replace one with the other. For example if you're asked what ##t^6## is, you can write ##t^6=(t^2)^3=x^3##.
But I'm not sure what exactly you have in mind. Perhaps you can clarify. Is there a specific problem where someone has told you that you can't replace ##t^2## with ##x##?
Note by the way that if you take the square root of both sides, you get ##|t|=\sqrt{x}##, not ##t=\sqrt{x}##. The statement ##t^2=x## implies that either ##t=\sqrt{x}## or ##t=-\sqrt{x}##.