One of the primary functions of security personnel that have been hired to protect the premises of a business that has a lot on the line is to ensure that no illicit products end up entering these premises. Sometimes this can be quite mundane such as in instances where a security guard might need to prevent people from bringing snacks into the movie theater due to the reason that this is the sort of thing that will help them avoid buying snacks at the counter which can subsequently result in a pretty huge loss of revenue for the theater in question without a shadow of a doubt.
That said, there are several examples of situations where security guards need to detect much more dangerous things such as drugs and potentially even weapons, and as a result of the fact that this is the case many people working in residential security might need to search someone or the other by patting them down. This raises the question of whether or not a male security guard can search a female person, and suffice it to say that there is no law that prevents them from doing so at this current point in time.
As long as the search does not involve the subject stripping all of their clothes off, a male guard can conduct the search with no real issues getting in their way. However, if the person getting searched needs to remove their clothing, a female guard should ideally do it so that the person does not end up feeling like their rights have been violated to any extent at all and would instead comply with the search all in all.