Contrive a plot which requires it
If you need a disparate group of individuals to team up and work together, you can devise a plot which requires their co-operation, at least to begin with. This is a common trope of fantasy/sci-fi fiction already, and it works in roleplaying games too. Many published adventures rely on this to hook a party in the first place; for instance, the Skull and Shackles adventure path from the Pathfinder line opens with the party being press-ganged into service on a pirate ship, and does not require them to know each other beforehand at all (and additionally the scenario is such that a character cannot easily just leave, even if they would like to). Once the initial hurdles which force the group to work together are overcome they can find they make an effective team, or have become friends, and they stick together.
Constrain character generation
A step further than forcing the characters together after they are created is to force them together before they are. Rather than offering completely free reign in character generation, constrain your players with some premises. For instance, you could ask that they all create characters who, for whatever individual reasons, are members of a particular mercenary band, or all have reason to seek a specific artifact, etc. One of the games I ran a while ago had the premise that all the characters were from a specific clan of dwarves in the setting, and they were being sent on a mission by their clan elders.
Assume some background
You don't always have to play through the initial getting to know each other phase of a group's lifecycle. If your players create their characters together, they could come up with some shared backstory which explains why the group is working together without having to try and force it during play, when they have possibly already committed to conflicting characters. This is basically just a softer form of constrained character generation - but it may work best if you have the kind of players who would chafe at a much more constrained premise, or grumble about the railroad if you use a plot device to force the group together.