Is it possible to limit the size of an APFS volume?
When creating an APFS volume, you can set a quota. In Disk Utility, in the sheet to create a new volume, choose Size Options and set a Quota Size.

The optional quota size limits how much storage this volume can allocate.

This can't be added or changed for an existing volume.