The error looks like an exception on server side thrown by the OData provider: To allow the Count query, you would put the [AllowQuery("Count")] (?) before the ASP.NET action / controller.
Edit 2: Clarification: this attribute would be needed on Microsoft's server side, not on client's "server"-side.
So nothing you can do, besides raising a feature request ;) Workaround: download all and count locally.
Btw, requesting the number of channels should be:
https://graph.microsoft.com/v1.0/teams/{team-id}/channels?$count=true
shouldn't it? But you'll still get the same error.
Edit: The docs say it all:
Note: $count is not supported for collections of resources that derive from directoryObject like collections of users or groups.
https://learn.microsoft.com/de-de/graph/query-parameters#count-parameter