You are using Case Merge Premium and would like to prevent users from accidentally merging cases from different Accounts
This can be accomplished through a Case Validation Rule such as the following:
For easy copy/paste flexibility, below is the exact criteria used for the Error Condition Formula:
ISPICKVAL(Status, 'Closed as Duplicate'),
AccountId != Parent.AccountId
If your organization uses a status other than "Closed as Duplicate" to denote cases closed as the result of a merge, please swap in that status value instead. Additional rules (or criteria to this rule) for comparison between cases can be added as needed.
To ensure the merge is completely prevented, ensure you've configured the Show Errors When Merging setting to either "Halt on Validation Error" or "Halt on Any Error".