Yes absolutely, but ATC has to follow regulations too, if the military declares an airspace prohibited or restricted ( for instance due military excersice or else) do not expect any a controller to you give you a clearance to deviate in there. In some countries ( e.g China,or North and South Korea ) this is extreme and can be on both sides of the track/airway..
Of course when you are PIC you can always decide and take your chances.
But think this scenario: a US registered aircraft penetrating a North Korean military airspace to deviate from a CB against ATC instructions ? I think I would rather take the CB or make a 180.
But OK , we do not know (yet) the real situation in this case ,