As far as I am aware, the origin of the module doesn’t matter to a Mendix application, and this isn’t exposed to the application itself.
If you are using the SDK to carry out analysis of your application, then you can use the fromAppStore() method when you inspect the module and this returns true if the module was downloaded from the Marketplace.
https://apidocs.rnd.mendix.com/modelsdk/latest/classes/projects.module.html#fromappstore
Hope this helps.