Typically the answer is yes. He should exercise care though. Most officers will have another officer - preferably a female officer present.
The only reason an officer should be placing his hand in anyone's pocket is to check for weapons. There is a lot of case law dealing with this issue. The primary case is Terry v. Ohio and its progeny. This type of frisk is called the Terry Frisk or a Stop & Frisk. An officer can briefly detain an individual to quickly see if he has broken the law.
The U.S. Supreme Court holds that for an officer to stop and frisk, he:
-Must be legally present at the scene. This means he must have detained the defendant lawfully; i.e., saw the person speeding, possession of contraband, fleeing, hanging around the outside of a business late at night, etc.
-The frisk must be "reasonable" in that officer is looking for dangerous objects in the pocket. The officer can squeeze the outside of the pocket and must feel something like a weapon before he can reach into the pocket. That is, if he squeezes the outside of the pocket and feels a bag of drugs, he DOES NOT HAVE authority to go into the pocket. If he feels something hard like a gun or knife, he can then go into the pocket and if he discovers contraband may make an arrest.
-Must have has reasonable suspicion to make the stop or contact the individual. He just can't stop you for no reason.
Hope this helps.