When you merge two accounts you are effectively deleting one of them. You can merge accounts if you are an administrator (modify all data permission), the account owner, or a user above the account owner in the role hierarchy and you have the appropriate user permissions.
First of all there are some permissions that you need to check in your profile:
1.)“Read” on accounts
2.)“Delete” on accounts
3.) “Edit” permissions on opportunities and cases, if the accounts have related opportunities and/or cases.
If you have all these permissions and are still experiencing the error you need to check the following:
i. Are you in an unrelated role in the hierarchy and check if you have access to the accounts thanks to a sharing rule. If you try to delete either one of the accounts that you are trying to merge, you will most likely get a similar Insufficient Privileges error.
ii. Sharing rules do not give users delete permissions, only read/edit.
While the sharing rule gives you read/write access to the Accounts, it doesn't give you the delete permission necessary for merging. You cannot delete an account you do not own, therefore you cannot merge two accounts that you do not own.
iii. Check all account team member's access to contact/case/opportunity, and make sure they do not have greater access than the surviving account owner's access. Eg, if account owner has read access to opportunity/contact, but some account team member has edit access to opportunity, the error will also occur.
If account team members do have greater access level, Modify All permission on Account entity would be required for a user who is performing the Merge process.
Best Answer
As far as a trigger goes, you can check in an after delete trigger if MasterRecordId is set, and if so, you know you have a merge on your hands:
Note that merging requires Delete and Edit Case permissions, so you can't outright block deletes just from Profile Permissions. A trigger is likely the correct solution in this situation.