What you saw was Terry Stop, and TV is not always accurate
Terry stop does not need consent. It is justified when police suspects a crime is on-going or about to happen. The police officer is limited to a pad down for weapon only. He is not allowed to search for stolen goods, drugs, and other evidence.
A police officer cannot search for stolen goods without consent.