(1) This code applies throughout the state. It also applies to all persons otherwise subject to this code while they are serving outside the state in the same manner and to the same extent as if they were serving inside the state.
(2) Courts-martial and courts of inquiry may be convened and held in units of the state, with the same jurisdiction and power as to persons subject to this code as if the proceedings were held inside the state, and offenses committed outside the state may be tried and punished either inside or outside the state.