The DoD Government Charge Card Guidebook for Establishing and Managing Purchase Travel, and Fuel Card Program covers policy for GPC purchases at the DoD level. Page A-21 of this Guidebook says that "GPC shall be the method of payment for all commercial training requests using the SF 182, valued at or below $25,000". It goes on to say "training, education, and professional development SF-182 actions are not FAR-based transactions. See DoDI 1400.25, Volume 410 for additional information regarding the appropriate use of the SF 182." The DoD Guidebook does not specifically address cancellation fees for an online class.
Referring then to DoDI 1400.25 Volume 420, it then depends on the type of training such as academic courses and certificates starting on page 20. Review the DoDI 1400.25 Volume 420 as well as your agency GPC instruction to see what the rules state for the expenses allowed for the applicable type of training. The instructions may be silent specific to cancellation fees for the specific kind of training, so then the official with the approval authority will need to make the decision to approve this expense.