Some species have a very flexible attitude to shoaling. Many fish have a concept of personal space and some of the more feisty tetras are probably better described as an aggregation, with each fish a discreet distance from the other. Such a group will appear to be a shoal in a big tank where the slightly grumpy sociability of these species will keep them in the same area.
The main purpose of tight shoaling is to avoid predation which shouldn't be an issue in an aquarium situation, but choosing natural shoalers and housing them in a large tank will go a long way. The key to this behaviour is keeping enough individuals to shoal - remember that species such as tetras would naturally occur in hundreds rather than twos and threes.
The fashion for nano tanks does little to encourage shoaling but in larger aquaria there's scope to combine large, non-predatory species alongside smaller tetras and barbs. Large gouramis (Trichopodus) for example can be intimidating enough to fulfil this role without being a danger.
There are very few species that will shoal in the average marine aquarium, but one species stands out as exceptional in this regard, namely the Red Spot Cardinalfish (Ostorhincus(Apogon) parvulus)