I am trying to figure if there is a better way to suppress automatically generated out of box activities ex: Claim/Exposure cannot be closed.
Is there a way to stop activity generation for these events?
see AddActivityPatternForClaimOrExposureUnableToCloseTrigger.class in the OOTB library where the pattern is used
One solution is preupdate rules to catch these activities and remove/complete them, although the documentation says to not use remove on out of box entities; so, the only solution is completing them. While it works it would be more effective to stop them from generating, or perhaps remove is ok in this instance?
This is a common ask I have seen over the years, especially for ClaimCenter. As you noted, there are some activities that are created in compiled code and are not easy (and maybe impossible) to prevent from opening. Creating a preupdate rule to complete or delete an activity of a certain pattern is not ideal either because an activity created in a preupdate rule will not trigger preupdate rules to run on that activity. See the link below (login required) and the quoted text:
https://docs.guidewire.com/self-managed/cc/1020/rules/cc/topics/c_fz16829231.html
The same behavior also applies to entities newly created in a preupdate rule. For example, if you create a new activity in a preupdate rule, ClaimCenter does not then run the Activity preupdate rules on that activity.
In the past the compromise I have suggested is to create a distributed work queue that runs on a similar interval as the Financials Escalation schedule that will look for all non-complete activities of a certain pattern and auto-complete them. It isn't the same as catching the activities before they can be committed to the DB, but I think actually catching these activities in all situations before they are committed to the DB is a fool's errand. The business and users just need to be aware that sometimes they'll see these activities, but there is a background process that handles them.
I should also note that when the documentation says to not remove OOTB entities, it is referring to not removing the eti or etx files that are shipped with ClaimCenter. You can remove rows from the DB for sure, albeit carefully and with consideration of the data you are removing.