It goes both ways. Any action can be attributed to selfish ambition, schools of modern psychology claim (which is a pretty straightforward exercise in logic), but that doesn't mean any action is necessarily without inherent selflessness. Individual and group thinking are not so easily seperated, and humans can sacrifice themselves for the group, like we see in most any war or conflict, a selfish and selfless act altogether, parents being selfless towards their offspring etc.
Anyway, most gains from say revolutions are not just abstract ideas but confer very solid individual rights to people, so as not be mutually exclusive.