Pretty much related to WC3 modding
First of all, you can bypass the 8MB filesize on multiplayer maps.
Secondly, (as mentioned before,) you can have good maps without huge quantity of ... heroes, items, units, abilities, doodads, etc, etc, etc.
Last but not least...
If it is an AoS map... an AoS/MOBA match should include 10-15% of the avaiable heroes.
This includes heroes being played but also heroes being banned or whatever you can do to them.
When you reach higher than that, your matches will look the same over and over again.
When you reach lower than that, your matches will be too unpredictable. (Can't find the right word for it but I think that this one comes pretty close.)
But anyway... yes, it is impossible to have infinite heroes, but also yes, you will be able to have such a high number that people don't recognize the difference between that value and infinite.
Calculating 50 minions, creeps, 15 dummies and 25 buildings... you will have 8k units avaiable.
However if you give every hero 5 abilities, you will only have a max of 1,400 heroes.