Not all states allow a prior court-martial conviction into evidence. But as the decision in Oliver v. Commonwealth, 60 S.E. 2d 567 (2005), shows, the Commonwealth of Virginia considers a prior special court-martial conviction admissible in sentencing.
In principle, we accept that certain "wholly unconstitutional" convictions can be collaterally attacked and disqualified for consideration during sentencing. United States v. Tucker, 404 U.S. 443 (1972). But, when available, the collateral attack remedy would not be offered on the ground that the invalid UCMJ conviction rested on something other than the "laws of … the United States" as that phrase appears in Code § 19.2-295.1. Instead, the invalid UCMJ conviction would be excluded from trial, if at all, because it violated a higher law of the United States: the Federal Constitution.
In any event, we need not address Oliver’s hypothesis further. He does not raise on appeal any constitutional objections in contest of his UCMJ convictions.