That's the theory.
In practice, the supermarket where I typically buy (because it's closest to home) is hit and miss. Sometimes they specify the origin, sometimes they don't. I'm sure if I asked they would tell me, but the process would probably involve an overworked cashier asking an equally overworked manager, plenty of waiting, making other customers wait as well, and being seen as the nitpicky guy who is always asking. Ideally it's what we all should do, but in practice I and most people I know have no time or willpower for that.
On the other hand, in small fruit stores and markets, the overwhelming majority of the fruit doesn't specify origin. I can ask and at those places I will probably get an immediate answer, of course. But then I have to trust the word of someone whose primary motivation is to sell me the fruit. My bet is that many wouldn't acknowledge it's from Morocco. And it's not like I can check.
If it were so easy, newspapers wouldn't be publishing "tricks" to try to identify Spanish fruit:
https://www-elespanol-com.translate.goog/cocinillas/actualid...
https://www-larazon-es.translate.goog/sociedad/asi-puedes-co...
Tricks that sadly aren't even guaranteed to work, because a Spanish company selling fruit from Morocco can use a Spanish barcode.