Guest access in Azure AD is governed by the External users settings. These settings are managed via the Azure Portal under Users | User settings | External users | Manage external collaboration settings, as shown in the following screenshot:
Under Manage external collaboration settings, Members can invite must be enabled for users to be able to invite guests within Microsoft Teams, as shown in the following screenshot: