There are multiple factors attributing to the quality of the image produced by any lens, but if we place some reasonable doubts like the manufacturer QC, the preservation and handling of the actual equipment, then it all boils down to reading the chart and knowing the tested quality of the lens.
Also even if the quality are comparable, each design and material of the lens and coating will influence the colour of the light passing through it.
There is no reason to believe prime must be better, it's just there are reasons to believe they are better due to less complicated design in the lens, less movable parts etc. There are zooms better than primes for example, you will find the Nikon 14-24 f/2.8 much better in built, design and imaging compared some older primes. Here the most obvious is of course technology. I would believe it's definitely a technical challenge to get a zoom lens of same or better quality than a prime. Question is a prime only have focal length to manage, a zoom has a range of continuous range to manage. Are you prepared to pay probable a few thousands percents more for the cost of a zoom to achieve the same quality as the prime lens ? Also are you prepared to hold a much heavier and longer lens ?
Go read the following links
Nikon | Imaging Products | AF Zoom-Nikkor 70-300mm f/4-5.6G (4.3x)
Nikon | Imaging Products | AF-S NIKKOR 300mm f/2.8G ED VR II