In class of Newton's laws of motion, it was explained that Newton's second law is valid only in inertial frames. Teacher give us a example by considering a lift which is going downwards with acceleration$=a$ then a man watching the lift from outside will write $mg-t=ma$ (where $m$ is mass of the lift and $t$ is upward force on the lift) while a man inside the lift will write $mg-t=0$ (for him there is no acceleration of lift) both equations will give us different value of $t$ so we have to have a frame specified for work ie inertial frame but nearly after 5 months I have a problem. In the observation of the man inside lift acceleration due to gravity is stated as $g$ but I think that it should have value $g-a$ (if a stone fall on Earth with acceleration $g$ then inside the lift it should fall with acceleration $g-a$) and then by substituting this value for acceleration due to gravity in equation of man inside lift we will get the same value of $t$ as we got in equations of man outside the lift. So if both frames give same value of $t$ then why we prefer one frame after other.
We prefer inertial frames because in most of the cases, the analysis can be done in a simpler way in these frames. We need to consider only physical forces due to other bodies (gravity and tension of the steel rope).
While in a non-inertial frame of the elevator, to make the Newton law valid we have to include additional force $-ma$ which has no source: there is no body which would act with this force on the elevator. Consequently the 3rd Newton law is not valid. This is the pre-Einsteinian point of view, which your teacher was trying to convey.
In an Einsteinian theory, all frames of reference are made equivalent, which is beautiful and lead to general theory of relativity. But it also brings a lot of new problems - it requires much more complicated mathematics than the previous approach, which is usually not necessary in most applications of mechanics.
What your teacher was referring to is the observation that Newton's Second Law remains unchanged in intertial frames. That is, the equation $F=ma$ looks the same no matter how fast I am moving.
As you pointed out in your example, in accelerating frames you have to change the left-hand-side of the equation to account for the pseudo-force due to your own acceleration. Thus, Newton's Second Law does not remain the same in accelerating frames. You can use the modified version of the law and everything will work, but usually this adds complications.
As a side note, we live in an accelerating frames due to the rotation of the earth. Thus, the equation $F=ma$ is not exact from our eyes point of view. For most everday problems, $F=ma$ is good enough. But if we want to be precise in our determination of projectile motion, there are additional terms (pseudoforces) known as the Centrifugal and Coriolos force that we have to add to the left-hand-side of $F=ma$ due to our rotating reference frame.