As for flashing lights in general, here in NYC the new Citibikes have flashing front and rear lights, and these are sanctioned by the city. I guess if they're illegal the city doesn't know it.
For brake lights, my MagnicLight has that function due to the fact that it is mounted on the brake arm, and draws power from the rotating rim. As you apply the brakes the light is closer to the rim and draws more power. I'll have to admit though it doesn't work too well the way I have it mounted, but I'm sure I could make it work better.