Sometimes I leave the first area getting only one additional hero and at times I get up to 4. Is there a deliberate way to get as many heroes as possible before you leave the first area? Or is it all random?
Without rigorous testing or word from the developer, we'll never know.
Personally, it seems to act like a weighted random system. I've noticed that you really don't get more heroes than currentLevel+X, and if you have currentLevel-Y heroes, they spawn more frequently to help fill in your numbers.
The exact heroes you get, and the order you get them in, can have a much bigger impact on your game than the quantity of heroes you manage to randomly acquire. Some heroes are better at the front of your line, some are better at the back, and obviously its advantageous if you get higher level heroes.