"Dan" was one of the northern most parts of ancient Israel, hence the expression "Dan to Beersheba" expressing all of Israel. See Judg 20:1, 1 Chron 21:2, etc.
The fact that Gen 14:14 uses the name of the town hundreds of years before it had that name is simply evidence that the Book of Genesis was written (or at least edited) well after the events it depicts.
If we assume the traditional authorship of Moses (who clearly wrote before Dan had this later name), then some scribe presumably altered the name of "Laish" to "Dan" so that his readers would understand what was written.
Thus, the book of Genesis appears to have been edited by others after its completion by the traditional Moses. The Pulpit commentary on Gen 14:14 has some interesting remarks but with little evidence.
Dan - which is here substituted for its older name Laish, for which
vide Joshua 19:47 (Ewald), though regarded by some as not the Laish
Dan conquered by the Danites, but probably Dan-jaan, mentioned in 2
Samuel 24:6 (Havernick, Keil, Kalisch); against which, however, is the
statement of Jose. phus ('Ant.,' 1:10), that this Dan was one of the
sources of the Jordan. Murphy regards Dan as the original designation
of the town, which was changed under the Sidonians to Laish (lion),
and restored at the conquest. Clericus suggests that the Jordan
fountain may have been styled Dan, "Judge," and the neighboring town
Laish, and that the Danites, observing the coincidence of the former
with the name of their own tribe, gave it to the city they had
conquered. Alford is doubtful whether Dan-juan was really different