I would first disconnect one of the leads on the brake pedal switch to eliminate that as a problem.

I suppose it's possible that the brake light switch has failed in some sort of manner that the switch is shorted and when the brake is applied, somehow the short is eliminated, making the brake lights go out.

With the brake light switch disconnected, check to see that the turn signals work normally, and the hazards work normally. If not, the problem is probably not the brake light switch, but somewhere downstream (turn signal switch, kick panel harness, taillight harness, ground at taillights, sockets, etc.)

My guess is that with the brake lights wacky, one or more of the turn signals are wacky, too.

You didn't make any wiring changes recently, did you?