Light from the sun that is reaching us now escaped the surface of the sun 8 minutes ago, yes.
But photons are generated in the core through nuclear reactions, where they take their sweet amount of thousands of years bouncing around until they get out.