Electrical glitches and an MG are inseparable. Lord Lucas' legacy. Especially as these cars get older.
That the lights work intermittently is a strong indication of a short or loose connection. I am also not sure of the red light that goes on when the brake lights are working. On many cars, there is a test switch, but you have to try that separately by pushing it. It does not go on every time you step on the brake. And I don't think it was on the original 66 dash.
I would suggest first checking the switch on the pedal assembly. Worn or loose, it could be out of place or only making contact intermittently.
From there, I would check the harness. Get a wiring diagram, which is available for download by Googling MGB Wiring Diagram on-line.
There is at least connection in the trunk that serves the rear brake lights and, as often happens, if it is corroded, the metal tube barrels inside are split or just loose, you will get issues as you are seeing. The original tubes are now available from Moss and Victoria British, so the fix is easier than making modern bullet connector adaptions.
I hope that helps you. Good luck and let me know what you find.
Safety Fast!
Art Isaacs