In the show "Space Force", the underfunded branch of the military makes a sponsorship deal with a company in order to raise some funds, where the general participates in a commercial and says something nice about the product.
I have not seen anything like this in real life, beyond "company X supports the US military", but I don't have the impression of a quid pro quo in those cases.
What laws govern the legality of such an advertising agreement, if any?