When you join a clan, you automatically become allies with anyone in that clan. This is a quick way to quickly build up your allies list so that your colleagues and friends can easily keep track of each other's progression and view their solutions.
Joining a clan is as simple as setting the clan name in your profile.
If you want to switch clans, you simply need to change the name.
If you want to leave a clan, set its name empty.
If you change or leave your clan, you are still allies with all its members. If you wish to not be associated with them anymore, you will have to manually unfollow everyone from the previous clan.
A new clan is created once a first member joins it. If you want to create a new clan, just enter a unique clan name in your profile, and it's done.