The establishment/mainstream is the real enemy of the people. It totally makes sense to support anyone who you think could realistically challenge and destroy the status quo.
A useful example might be to look at the fallout of the various protests during Arab Spring, and how it led to both more liberal and less liberal outcomes.
Anti-establishmentarianism can bring together people of different political persuasions who all want to dismantle parts of the current system. What comes after that is a new battle, and that one may end up fought along more traditionally ideological lines.