check the linkages, shifter stabilizer bushings. If both are good then a bent shift fork or possibly the syncro, and yes worn out syncro/ dog gears can make the car pop out of gear.
Either way, if the first 2 things are good then time for a rebuild.