Ancient Athens had ostracism [1]. It was against a single person and not against ideas but given that the numbers where smaller and heads carry ideas, it was more or less the same thing.
China is famously very accepting of all ideas and would never ban or ostracize members of its own society for perspectives that disagree with the majority's belief.
Cancel culture isn't that either. Cancel culture is a rebranding of 'shunning', which I bet predates humans as we know them. I bet our social monkey predecessors had such tactics figured out.
[1] https://en.wikipedia.org/wiki/Ostracism