I don’t think it’s against the rules because those kinds of rules don’t apply to POTUS I don’t think.
I also don’t think it’s necessarily unprecedented because politicians are always celebrating buying American or different companies, even if not quite as directly as he did with Tesla.
From a practical perspective, I’d think it’s more counterproductive to have a POTUS specifically endorsing your product because it becomes a politicized product, which is not something most companies would want.
I assume it's not illegal.