...
Both of these features provide different ways to shape different forms of smaller group discussions, with Cohorts typically being used for larger learner groupings (hundreds of learners) whereas Teams are typically used for smaller learner groupings (5-10).
Moodle
Moodle discussion forums are created under individual topics, which can then be put into “Group Mode”. There are three settings possible for this property:
...
It does not appear as though there is a way to only make certain groups “count” for discussion activities. Therefore, in a situation where a learner is a member of many groups for different purposes, instead of being able to select a group mode, the common workaround is to create a discussion forum for all users, restrict posting, and then create a separate discussion thread for each group, restricted to each group. This removes a layer of the hierarchy, and is a clunky experience for staff.
Canvas
In Canvas, group discussions can be enabled with a checkbox when configuring the discussion. Once checked, the instructor can then choose which group set to divide learners using. The instructor also gains access to the tools required to create groups and group sets when configuring the group discussion, just in case the group they want to use does not yet exist.
...