Self dealing is also permissible with companies. Corporate officers and directors must still meet their fiduciary duties to shareholders. And the potential for conflict of interest changes how courts will evaluate the transaction if a shareholder complains about a breach of fiduciary duties. Ordinarily, in Delaware, operate transactions are protected by the “business judgment rule” that gives wide latitude to corporate officers and directors. https://plusblog.org/2023/11/28/the-business-judgement-rule-.... But if there is self dealing, courts will scrutinize the actual fairness of the transaction. But self dealing isn’t per se impermissible.
In most countries you absolutely can. The difference between market value and the sale price might be considered and taxed as a gift, but such a deal is generally not prohibited.