I just installed open atrium and was amazed how it works and how its made. It is made to work with just some clicks while installation. I want to build something like this. I just want to pre configure just blogs, gallery and forums and with some groups. Installation profile knowledge i need. what else should i know properly so as to build such a thing.
You're going to want to understand the relationship between Organic Groups, Spaces, Context, Features and possibility the Persistent URL and Strongarm modules. Aside from Organic Groups, they were all created by the same developer who started Open Atrium.
Be warned: I don't think I've seen a more complex site built with Drupal. Most of those modules are not only complex, but also genius.
I think if you are wanting to get this involved in drupal installation profiles and how the sites work, it would be a good idea to research using Drush. Its a command line tool for working and administering Drupal.