So let me get this straight. Some addons are paid via Patreon of its developers. But once bought and then installed, these addons source codes can be viewed and distributed to others who might want to use these “paid” addons, right??
It depends on a licence of the addon but basically, an open source software can be sold and the purchaser can redistribute the software for free or against paiment.
If your question is “is there a way to prevent (ie. to make it “physically” impossible, not just legally) for users who are using an add-on that should be behind a paywall to just share it (for free or not)?”, then what you are looking for is usually called DRM, and the answer is no. To be clear: DRM are always a pain in the ass (for the user), and paid software / services / media / music / … that do not enforce DRM do not file bankruptcy. Unless you are already facing a serious issue where you see that most users do not pay for an add-on, I wouldn’t mind too much about it.
Here is a comic summarizing why DRM enforcing is annoying for the user (xkcd: Steal This Comic):
If the question was “is it possible to make it legally impossible?” then the answer is yes, it’s actually quite easy: you just need to license your code (and/or anything else that you provide with the add-on). There are plenty of resources on how to do that, which license to choose, etc. Just to give you an example, you can visit https://choosealicense.com/ if you are looking for copyleft licenses (ie. licenses that provide great freedom to the end user), but there is also About The Licenses - Creative Commons or many others.