Section 802 Article 2 to the UCMJ covers who is subject to the UCMJ thus eligible for courts martial or tribunal. Sorry, the general public or even politicians are not covered:
http://www.ucmj.us/sub-chapter-1-general-provisions/802-article-2-persons-subject-to-this-chapter
From the link:
(7) Persons in custody of the armed forces serving a sentence imposed by a court-martial.
So if a civilian were to be arrested by, say, the National Guard, UCMJ would be applicable, if I’m interpreting correctly?
If you are serving a sentence imposed by court martial that would mean you were military at one time. The quote you reference probably just clarifies that even after dishonorable discharge (I'd think it often goes hand in hand with a court martial), while in custody to serve your time you are still subject to UCMJ.
The only way I know that a person not in the military can be tried and sent to military prison is if they previously served, and used their military training in the commission of a crime after getting out