It is possible to leave both a group and a workspace, but certain conditions apply:
For a group: You must ask one of the group admins to remove you as a participant. If you are an admin, you can assign another participant as an admin before removing yourself from the chat.
For a workspace: You can leave it on your own unless you are the creator. The creator of a workspace cannot leave it.