Partially, it already is.
Operators usually have a thing called a
poll function, which determines in what context the operator is allowed to run.
For example, the Delete Edge Loop operator is only allowed to run in Edit Mode, since it works on the edges you have selected. It cannot run in Object Mode.
If you search for this operator, it will only appear if you are in Edit Mode.
Similarly, you can only delete an edge loop from the 3D View. Being able to delete edge loops of a mesh from the Node Editor would be weird. The poll function checks for this, and at the same time hides it from the search tool if you’re in the wrong editor.
In many cases though, operators are technically allowed to run in a variety of contexts, even if it doesn’t seem 100% appropriate. E.g. Updating the audio animation cache while in edit mode is unusual, but there’s no reason you shouldn’t be able to.
While this does clutter the search tool a bit, I think it’s a good thing that Blender lets you do what you want if there’s no solid reason to prevent it.
Then again, in some cases (often in add-ons) it’s just a matter of the programmer not being careful/specific enough about what context is allowed. There seems to be a lot of Video Sequence Editor operators that require selections in the VSE (e.g. Make Meta Strip) that accessible from the 3D View, which should be prevented IMO.