so...
I'm guessing what exactly the scenario is.
You've got object "A" and object "B", and they each have a variable (let's call it "var").
You're trying to destroy all instances of "A" and "B" that have variable "var" set to 1?
If that's the case...
Put "A" and "B" into a family.
Remove the variable from both object types.
Now select the family in the Project panel, under "Families".
In the Object Properties panel, create a variable for that family.
Rework your events to use the family instead of "A" and "B".