Droids in Star Wars are known to have their own personality. Even astrodroids, like R2-D2 or BB-8 sometimes do not listen to a direct order, or do things based on their "moral" evaluation (e.g. when BB-8 told about secret Rebellion base simply because it trusted Finn).
Therefore, it must have happened that droids didn't listen to its owner. I know that there are supposed to be "restriction collars" which pretty much force droids to do what you want them to do, but apart from that, what are other possibilities of enforcing a command on a droid?
Specifically: is there any way to externally turn off a droid? Via a remote or some button located on its metal body? In case the droid don't want to be turned off? I know droids may shut down due to damage (for example ion blast), or because they want to (R2-D2 in Force Awakens), but is there a way for the owner to do it? Or possibly even for non-owner?
Looking mostly for canon answer, if there is such information in any of the books, but any information is fine.