Answers (2)
Technically & ethically yes, as long as they operate with the permission and within the legal limits the administration of the state they serve have set. If their operations are performed outside of the state, then most likely no, if without or outside the host governments knowledge & permission.
If the question was about being morally right or wrong however, then it becomes murkier and subjective, as it becomes dependent upon values, principles, political & economic allegiances on how you view their activities I believe.
If we bring industrial espionage in, then both legality & morality become compromised very easily!