It has always been a problem and approached in a patchy way.
Doctors 1 and 2 were on the run from the Time Lords and actively attempted to dodge them so you would think they and the Time Lords would remember saving Gallifrey from Omega in The Three Doctors.
The second Doctor remembers it as does the Brig in The Five Doctors but Sarah Jane forgets what happens in The Five Doctors as apparently does the Tenth (see School Reunion for details).
The Second Doctor despite being on the run from the Time Lords is seen to be working for them with an older Jamie and the wrong console room in The Two Doctors.
In Time Crash the Fifth Doctor witnesses the Tenth Doctor perform a bit of jiggery pokery with the Tardis controls and remembers it long enough to perform it as the Tenth Doctor.
Then there are the memories of the multiple Doctors and companions in the mini-episodes Time and Space where the Tardis lands inside itself but drifts out of phase in time.
As mentioned earlier you have the Morbius Doctors but Hurndell/Hartnell Doctor is the first and there can only be 13 but John Hurt plays a Doctor in the end and Dave Tennant regenerated twice.
Clara in her tour of the universe stood in the spot occupied by Leela in The Invasion Of Time so what happened to Leela (was she possessed by Clara or did she change the past so she stood there instead?).
If you worry about these things and not what on Earth the BBC were thinking when they spent hard cash on Rings Of Akhaten your mind will pop.
But don't worry it won't really burn because I was lying about that when I wiped your memory of you traveling with me because you just reminded me too much of that awful woman off the telly too much.
Continuity makes no sense in a fictional universe where time travel can change the past, present and future or move the 1980 where safari suits are in back to 1974 (UNIT Dating controversy).