Short answer
Yes, a foreign company can register a trademark in the Middle East. However, in many countries in the region, a foreign applicant can't file directly. The application has to go through a local trademark agent or law firm that you appoint to act on your behalf.