Hello Corporate Drone,
Good day! Thank you for posting to Microsoft Community.
May I confirm if both company A and B are using the same tenant? Like email addresses in A and B are managed in the same M365 admin center? If A and B are two different tenants, then you can't set up delegation for these since users are picked from the Global address list.
If these are in the same tenant, then you can set up delegation in two different ways. From the M365 Admin center (this will need admin access) or from the Outlook application.
From the admin center, when the admin gives email B mailbox permissions to Email A, then you can use email B to send email on behalf of A. More info at Give mailbox permissions to another user - Admin Help - Microsoft 365 admin | Microsoft Learn. After this is set up, while sending or replying to email from B, you can change the from address to A.
In the Outlook desktop client, you can set up mailbox delegation using the steps in this article. Add and manage delegates in Outlook for Mac - Microsoft Support.
In case I misunderstood you in anyway or need any clarification, please let me know.
Thank you for your precious time and have a great day.
Best Regards,
Ashraf.