It is not necessary to open the doors in order to exit the TARDIS.
The first occasion on which this is demonstrated appears to be episode 1 of The Wheel in Space (1968). Although the episode does not survive on film, so the point cannot be directly checked, it is suggested in some sources that in this episode the Doctor and Jamie leave the TARDIS through an emergency exit out of the back of the Police Box shell.
See: http://guide.doctorwhonews.net/story.php?story=TheWheelInSpace (quoting from the book Doctor Who: The Second Doctor Handbook by Howe, Stammers, Walker).
The second occasion on which this appears to occur is in Logopolis (1981), which also seems to imply the Tardis has an emergency exit at the rear. The Doctor's escape onto the Barnet bypass 21 minutes into episode 1, after the two Tardises have become trapped inside one another, in what Adric believes to be an infinite regression, appears to only be explainable by the existence of such an exit.
A third occasion involves something slightly different. In The Three Doctors (1972), Patrick Troughton's Doctor enters the TARDIS in episode 1 without using the doors. He subsequently departs from the TARDIS, at the end of episode 4, also without using the doors. Both of these incidents involve his character materialising/dematerialising at the control of the Timelords, and presumably (the point is never clarified) involves either a Time Ring (see: Genesis of the Daleks, 1975) or the Time Scoop (see: The Five Doctors, 1983).
Genesis of the Daleks is NOT such a case, since although the time ring which the Doctor has in his possession during that serial is used to move him and his companions from one point in time-and-space to another, neither their starting point nor their destination is within the Doctor's Tardis.
A fourth occasion again involves a different method. In The Time Monster (1973), the Doctor confronts the Master whilst they are both travelling through the time vortex in their respective Tardises, and the Master uses his more advanced model of Tardis to cast the Doctor into the vortex to his doom. The Doctor exits his Tardis by dematerialisation, without using the doors. Later, he re-enters his Tardis using the same method, albeit with assistance from Jo manipulating some of the controls, but also without using the doors.
A fifth occasion, using an entirely different process, appears to occur twice: firstly in 1968, and subsequently in 1984. In 1968, during The Mind Robber, the Doctor exits the Tardis when it breaks up around him, and re-enters it in the final episode only when it re-forms round him. It is left ambiguous as to whether this serial was a dream.
However, in the 1984 serial Frontios very much the same thing happens, with the Tardis breaking up on arrival on the planet and reforming at the end of the final episode, in an echo of the events of 1968 - but without any of the original ambiguity.
A sixth occasion also twice recurs: in The Time Monster (1973) and in Logopolis (1981). In both serials the Master pilots his Tardis so that it arrives within the Doctor's Tardis -- or, pretty much the same thing, the Doctor makes a piloting error such that the Master's Tardis ends up inside the Doctor's (when the Doctor was hoping for the reverse to occur). And in Logopolis we additionally witness the Master's Tardis hopping about from one location to another inside the Doctor's, as the Master seeks to avoid being spotted.
All of these incidents illustrate one or other of the various methods (five in all) for entering or exiting the TARDIS without opening the main doors.