Verify if unrelated items are in the cart
In essence, if I am reading that right, can you reverse the question?  I.e. it seems that what you want to know is, for each accessory in the cart, is there a reverse relation back to at least one product in the cart.

This is definitely possible - you can read about reverse relations here: https://straightupcraft.com/articles/introduction-to-relations-and-reverse-relations-in-craft-cms-with-examples and of course at https://craftcms.com/docs/relations

..basically just loop through each accessory and check the |length of the result of a relatedTo that specifies what you want it to be related to (.e.g a product category).