The first mover has an advantage, but it's not overwhelming. IBM didn't come out with the first personal computer - Apple and Commodore did. Microsoft didn't have the first operating system for x86 machines - Digital Research did. AOL once dominated social networking. Facebook moved into a quite mature space - Myspace, Geocities, and several others were big companies when Facebook started.
Luck does indeed play a big part. If Gary Kildall, the author of CP/M, had been in the office the day IBM was looking for an OS for their new PC, the history of personal computing could have been very different.