Being reasonably familiar with the creation kit and scripting I am quite certain it is possible.
I would be quite surprised if a mod like that didn't already exist.
However, I have no knowledge of such a mod, mostly because I have not gone looking for one.
As for how... There is probably more than one way to do it. I believe most common items have a keyword, such as "ItemVendorClothing" or "ItemVendorJewelry" (I don't know exactly what they are).
Such items are sellable at vendors. I expect if you remove such keywords from items when you wear them (and replace the keywords when you unequip the items) that would work.
Alternatively there may be a keyword that prevents items from being sold (or there may be a way to make such a keyword). Using your own keyword would be simpler than trying to keep track of which keywords were removed from which items.
Alternatively I expect vendor sellable items appear on some sort of list somewhere. There may be a way to remove equipped items from the list (although I expect you would run into a problem of not being able to purchase those items).
I am less familiar with lists so I don't know much about this option.
legume.