Anyone can attempt to use Sleight of Hand to steal something mid-combat. For most PCs, this will require their action to make this attempt. Others may be able to use their bonus action.
As for whether or not the creature uses its passive Perception or a contested check would largely fall to the DM's discretion. Personally, I would look to the description in the rogue class for this sort of action since two of the roguish archetypes in the PHB specifically call out Sleight of Hand.
First, the Thief archetype on PHB p.97:
Starting at 3rd level, you can use the bonus action granted by your Cunning Action to make a Dexterity (Sleight of Hand) check, user your thieves' tools to disarm a trap or open a lock, or take the Use an Object action.
and on PHB p.98 under the Arcane Trickster archetype (emphasis mine):
Mage Hand Legerdemain
Starting at 3rd level, when you cast mage hand, you can make the spectral hand invisible, and you can perform the following additional tasks with it:
- You can stow one object the hand is holding in a container worn or carried by another creature.
- You can retrieve an object in a container worn or carried by another creature.
- You can use thieves' tools to pick locks and disarm traps at range.
You can perform one of these tasks without being noticed by a creature
if you succeed on a Dexterity (Sleight of Hand) check contested by the
creature's Wisdom (Perception) check.
In addition, you can use the
bonus action granted by your Cunning Action to control the hand.
In the case of Fast Hands, it is not specified and the choice of passive/contested would therefore be left up to the DM. For Mage Hand Legerdemain, it specifically states that it would be a contested check.
As a DM, I would first consider whether the creature was aware of your presence. In a case where you have not been seen (you were hiding before combat began), I would probably use the passive perception. However, if the creature is aware you are out there somewhere (you hid after it initially saw you) then it makes sense to me to use a contested check because the creature would be actively looking for threats at that point. If you weren't hidden at all and attempted to steal an item while engaged with the creature, I would probably also apply disadvantage if you couldn't give me a reasonable explanation of how you might do it without them noticing (see examples below). And of course, there are some items that I may rule were impossible to steal at that point in time.
The PC moves as if to grab the jailer, but it is really a distraction so he can palm the key sticking out from the jailer's vest pocket.
A rogue attacks with his main hand. At the end of his attack action, while the creature is still distracted by the attack weapon, his off hand darts in during his bonus action to steal a potion.
The barbarian attempts to steal a dagger from their opponent's belt sheath without any distraction at all.
In examples 1 and 2, I would allow them to roll contested checks. Example 3 would be rolled at disadvantage.
One last note, I would apply these same principles to any Sleight of Hand attempt used outside combat as well.