During the 300,000 years after the Big Bang, during the 'fog' era when the plasma was opaque at 4000K, what would have been the mean free path of a photon? As a comparison, I have read somewhere that the mean free path of a photon at the centre of the sun may be approximately 1 cm thus giving these long times for a photon to get 'out' of the sun.
I understand that after this phase, after recombination (a misnomer as there was no prior combination), when the foggy opaque mess became clear space, then the mean free path became essentially infinite in the order of the Hubble Length (14 billion light-years).
That is a great question! You are absolutely right that in the first 370 000 years the mean free path of photons was very small, much smaller than the size of the universe. The mean free path is the average distance a photon travels before it scatters.
At this early stage this density was so high that photons kept bumping into electrons and got scattered around. This is why we say the universe was opaque back then.
Then after around 370 000 years of cooling down by expanding something changed. As the universe cools down the average energy of photons, protons and electrons become less. At this point, the energy became low enough that electrons and protons were able to combine into neutral hydrogen. Before this point photons had enough energy to smash them back apart, but after that, they just pass right by. We also often call this last scattering: Ever since their last scattering around this time, these photons have been freely floating through the universe. In other words, the mean free path of the photons is now bigger than the size of the universe and we see them today as the CMB.
The exact number for the mean free path depends on the exact time and also on our definition of length (the universe has expanded by a factor of more than a thousand since then). In general, in the first few seconds of the universe, the mean free path is much smaller than a millimeter. Right before recombination, the mean free path is a few hundred lightyears. Then around 370 000 years, it gets bigger rapidly, becoming larger than the size of the universe.