Supernova ejecta expand at velocities between 5,000 km/s and 30,000 km/s. Lets take 10,000 km/s as typical. The speed of light, c, is 300,000 km/s, so 10,000 km/s = c/30. So, it would take 120 years for metals from the nearest stars to get to the Sun. How much time was available? Star formation in galaxies was well along 1 billion years after the Big Bang, 12.7 Gyr ago, and the Sun is 4.7 Gyr old. So that gives 8 Gyr of travel time for debris from the first massive stars which become supernova in less then 100 million years. Thus, the traveled length of the debris is 8 Gyr * c/30 is about 270 million light years. In other words, there was sufficient time for supernova debris from our galaxy and hundreds of other galaxies to reach the solar protoplanetary nebula. The story of course is different for the metals that come from progenitors that are not massive stars because of the longer delay for them to form.
I should add that the debris is likely to encounter intergalactic material along the way which will eventually halt its motion. So realistically material will rarely move quite that far.