Yes, to undercutting the engagement dogs, IF the dogs are not rounded too much. As Goose says, though, the worn thrust washer is the cause of popping out of second. The worn thrush washer allows the second gear to move laterally away from its mate, until the engagement dogs can't get a grip. Each time that happens the dog wears off the corner some more.
So, you MAY be able to reuse the second gear, depending on the amount of wear on the dogs. Undercutting will help, but it is not what is needed to FIX the problem.
The shift fork sometimes gets bent when second gear pops out, especially if the rider is using the gear shift lever to try and hold the second gear in engagement. Some folks have straightened a slightly bent shift fork, but there are no guarantees.