You can compare people that play on different teams fairly, you just have to take a LOT into consideration and judge their performance based on the context of their team - aka how adequately they perform their role within said team. If you understand how each team plays (how they approach creating and capitalising on advantages etc) and the best methods for that class to help their team do that, you can rate people independently of their teams and even the era in which they played.
So much can change between teams in this game tho, so it's hard to compare players properly like this. I've been doing this for years and most of the time I say 'i could be wrong' because unless I've properly watched STVs and povs of the player and team, there will be a lot of missing context. I think 99% of the time there is a comparison between two players it lacks the context and depth to make it valid analysis (especially considering most players make judgements based on logs or fragvids).
Edit: and none of that is even taking into consideration things like calling and team morale etc so like ye tf2 is complicated