The word environ is in fact an adverb and not a preposition (and there’s also an identically-spelled noun). The fragment « environ 20 étudiants » is a complement of the verb avoir, and the adverb environ is a complement of the noun étudiants. One piece of evidence showing that it’s an adverb is that it can also be placed after the noun:
Il y a 20 étudiants environ dans la salle. (correct and idiomatic but rarer)
Another piece of evidence is that you can put any preposition before it.
J’ai fait cours à environ 20 étudiants.
Cette salle est trop petite pour environ 100 étudiants.
Environ as a preposition is rare and dated; it sounds incorrect to my ears. Here is an example by Anatole France (given by the TLF):
Environ cette époque, à la tombée d’un beau jour d’été, …
The word loin is rather analogous to far in English, except that it cannot be an adjective (éloigné would be the corresponding adjective). Uses as an adverb are common.
Qui veut aller loin ménage sa monture.
French proverb, literally “He who wants to go far takes care of his mount”.
Tu vas trop loin.
You’re going too far. (Like in English, this can be literal but is more common in a figurative sense of overstepping the bounds of proper behavior, exaggerating.)