Yes, for what is connected to Morocco. Companies, whether or not they have a head office in Morocco, are taxable in respect of all the products, profits, and income relating to the property they own, the activity they carry on, and the profit-making operations they perform in Morocco, even on an occasional basis (art. 5). The right to tax may also be allocated to Morocco under double taxation avoidance conventions (art. 5).
The case of non-resident companies. A company with no head office in Morocco is also taxable in respect of the gross income listed in article 15, which it receives in consideration for works it carries out or services it renders in Morocco — whether for its own branches/establishments in Morocco or for persons domiciled or carrying on an activity in Morocco (art. 5).
The "non-intervening head office" exception. This rule does not apply where the works or services are carried out in Morocco by a Moroccan branch or establishment of the non-resident company, without the intervention of the foreign head office. In that case, the remuneration is included in the taxable result of the branch, which is then taxed as a company governed by Moroccan law (art. 5). Your connection to Morocco therefore determines the extent of your taxation.
This is general legal information, not legal advice. For advice on your specific situation, consult a lawyer admitted to the Bar in Morocco.