I'm going to go against the grain and say that I would not encourage off-lead socialisation with random dogs met on walks or with groups of dogs in the park. For every dog that turns out just fine with this approach, I think there's another one out there that's becoming the teenage horror, that finds playing with other dogs so all-consumingly thrilling and rewarding that they bog off at any opportunity. I don't want to model behaviour based on the 'he's only being friendly' brigade, who often have a poor understanding of dog body language and behaviour, neither is it their dog's responsibility to police my dog's behaviour by snapping/correcting. That's for me to sort out!
I also don't think it's ever ok to allow a dog to approach an on-lead dog, or even an off-lead one that is otherwise minding its own business and showing no interest in interacting, though I appreciate that my opinion on this is coloured by lots of other factors.
For that reason I prefer to take the approach of teaching recall, focus games, 'watch me', hand targets etc. at home and in the garden first before ramping up the distractions, and at least initially avoiding setting them up for failure by avoiding high volume areas and/or using a long line until the behaviours you want are sufficiently proofed. A good dog training class will aid with this - the set-up of the Dogs Trust Dog School is fantastic, they use curtained-off bays which get moved further and further back each week as the dogs progress.
This is a very rambly way of answering your question with 'as soon as they will look to me amid distraction'. For one of my dogs this was somewhere near two years, for the latest it was about 14 weeks (very different breeds and circumstances, in fairness).