You can play any composition you like. There are no rules in place,but it’s common practice to have a main and an offtank due to their synergy together.
Rein with Zarya, Winston with Dva, Orisa with Roadhog and Hammond being the only wild card, because he is very different. Dva works with everything very well, but Winston is the main that synergises best with her.
Tanks are necessary for creating space and allowing your team to push or hold by absorbing damage for them.
There is far too much burst damage and one shots in the game, that if you play without a main tank, your other non mobile dps and support heroes will drop like flies.
If the pros figured out a better comp that didn’t inlcude main or any tanks, we would be seeing comps without any.
It’s the same reason you need healers. Without them you are probably not going to have enough sustain to succeed against a team that has ones.