You can programmatically create groups . There is a property called SiteGroups inside SPWeb class.
You can use this SiteGroups property to add the group programmatically.
The following snippet should do the trick
//Add the group to the SPWeb web
web.SiteGroups.Add(groupName, owner, defaultuser, description);
//Associate de group to the SPWeb. Now it will display in the quick launch bar
web.AssociatedGroups.Add(web.SiteGroups[groupName);
web.Update();