The 3rd fret is slightly higher than it should be so when you are pressing on the 2nd fret it is actually the (too high) 3rd fret which is pivoting the string . If this is only happening on the top e string it could just be that the fret is loose at that end of the fingerboard .
If I were you I would take off all the strings and examine the neck of the guitar - hold a long steel rule or straight edge over the frets all along the neck of the guitar and see if any are markedly out of line . (You will notice with the strings off the neck will bow outwards very slightly - this is normal) If any frets are out of line you can try to hammer them gently with a rubber mallet taking care to support the neck directly under where you are hammering .
Another problem you may be having is that the "action" of the strings is too low (i.e. the height of the strings above the neck) This can be adjusted by raising the height of the bridge (where the strings pivot at the bottom end of the guitar) Most bridges can be adjusted .
Another problem could be the "neck relief " . This is the "bow" that I referred to earlier , only when all the strings are fitted and tensioned , the neck bows the other way i.e. inwards . This bow can be varied by turning the allen key bolt which you can see at the top of the neck usually covered by a small removable plate , or at the bottom of the neck( just inside the sound hole on acoustics) . This is a tricky adjustment - it may be better to take it to a music shop to do this . (if you got the guitar from a music shop they should do this for you )



