Controlling settings, permissions, and membership within Teams and channels
To add external users to a private channel, you must first add them to the Team. If you don't want guests to access the Team itself, create a shared channel and add them there. Note that enabling shared channels requires some setup.
One last thing to note: not all companies have external chat enabled in Teams. This means that you might try to add someone and it's blocked.
https://learn.microsoft.com/en-us/microsoftteams/private-channels
"Anyone, including guests, can be added as a member of a private channel as long as they're existing members of the team."
https://learn.microsoft.com/en-us/microsoftteams/shared-channels
"While guests (people with Microsoft Entra guest accounts in your organization) can't be added to a shared channel, you can invite people outside your organization to participate in a shared channel by using Microsoft Entra B2B direct connect."