it depends of the ride and depend on your goals..
and there are different type of what i'd call hammer fests.
1) you can have 2-3hr long very jumpy, uneven type rides where it is very hard to do SST training in... but why would anyone in their right mind go to such a ride to do your SST training anyway? you do that ride to get your higher end stuff/race simulation in.. you need to be intelligent about it.. do your SST during the week or an appropriate group ride.. you can just ride on the front all the time or something that other don't think about it is ride at the back but in the wind... but you do stand the chance of getting dropped if the group really gets going.. you're going to be much more tired that everyone else.. but you need to be disciplined and selfish and stick to your goals and get the ride in that you want to get in.. but like i said.. why make life difficult for yourself.. pick the appropriate ride to get the appropriate workout in the first place and you don't have to then try to shoehorn a ride into what you want to make it...
2)or you can have very fast long 5-6hr rides with steady pacelines.. usually you have everyone participating at first then people just start taking turns off and you end up with just 3-4 guys pulling.. that latter type are perfect for doing huge, HUGE volume of SST.. you would almost never be able to do that kind of volume of SST by yourself.. sometimes on a ride like this i'm not looking for threshold or SST work and am just looking for an endurance ride so i just sit in.. you have to be very disciplined to not fall into the trap of just following what the group is doing.. if you can't be disciplined then you're probably better to just not do the ride.
i have both the above kinds of the above group rides at my disposal so i'm kind of lucky that way..
but it's pretty simple if you can make a group ride into what you want, then do it.. if you can't, then don't or do that training on another day or forgo the group ride 'til you want what the group ride will provide..
the thing is that you will realistically need to do the vast majority of your training alone.. you just need that control and you need to be efficient with your time. but group rides, if you are disciplined and use them appropriately can be great to simulate racing, do high end training or get huge volumes SST or endurance training in (if appropriate ride chosen and ridden appropriately) that would be very hard to do by yourself..