I'm not quite sure what this function does but shouldn't the context matter here? e.g.

    >> (a`x^2 + b`x^2) /. a`x -> z
     = b`x^2 + z^2
    >> (a`x^2 + b`x^2) /. x -> z
     = a`x^2 + b`x^2