The standard monsters that I could find in the Monster Manual with the ability to cast dispel magic are:
- Death Knight (pg. 47)
- Glabrezu (pg. 58)
- Drider with the spellcasting variant (pg. 120)
- Drow Priestess (pg. 129)
- Lich (pg. 202)
- Mummy Lord (pg. 229)
- Pixie (pg. 253)
- Androsphinx (pg. 281)
- Gynosphinx (pg. 282)
- Mezzoloth (pg. 313)
- Nycaloth (pg. 314)
- Ultroloth (pg. 314)
- And the standard NPC Priest in Appendix B (pg. 348)
Most of these are the kind of monster that would almost certainly attack the party. The NPC Priest might not, but I can't see a reason for a priest to randomly dispel someone's shelter then walk away (unless their god has strong objections to that specific spell, but that seems forced). The sphinxes also don't tend to attack people, but they're rare, completely level-inappropriate, and don't move around much.
The only one of those monsters that I can see randomly dispelling but not attacking is the Pixie. If you read their lore, you can see that they love to troll people without any hostile intent, so this sort of thing is right in their wheelhouse. It also appears to suit your other requirements (easy to kill if it comes to a fight).
This is the kind of thing the DM handwaves away. The rules make it impossible for a creature lacking racial Hit Dice that advances exclusively by level not to have at least 1 level in a class, usually, unfortunately, commoner. Being a level 1 commoner might as well be the same thing as having no combat knowledge; ignoring the orphan's ability scores, the orphan'll be proficient with 1 simple weapon, have 8 skill points, no base attack bonus, no bonus to his saving throws, and all of 2 hp. Because he already exists, though, he does have his starting feat... maybe even two. He remains alive because PCs don't look at him too hard.1
But, with some work, the PCs can turn the little scamp into someone who can contribute. The PCs'll probably have to hold his hand, though, because
Following the Rules as Written to "train" an NPC is extremely dangerous for the NPC
The only rules-as-written thing the PCs can do to "train" the orphan is include the orphan in their adventures. Having the orphan participate in encounters gets the orphan an even share of the encounter's XP value (DMG 36-7), but the DM must rule the orphan participated in the encounter. (Stuffing the orphan into a bag holding when the encounter begins may or may not count.2)
Example
The 4 5th-level PCs and 1 1st-level NPC survive an encounter with 1 Challenge Rating 6 creature. Each of the 4 5th-level PCs earns 450 XP, but the 1st-level 1 NPC earns 540 XP. Another encounter like that takes the 1st-level NPC to level 2!
When the orphan has XP enough to advance a level, the DM makes any decisions about how he gains that level as the DM controls all of the campaign's characters but the PCs. If the DM decides the rambunctious little nitwit continues taking commoner levels, there's really nothing the PCs can do about it except look on in horror.
Persuading the DM: Some Options
Broadly speaking, there are two alternate ways that PCs may persuade the DM that the orphan shouldn't take his next level as commoner. Neither are very good in that the PCs still have no influence over the NPC and both are meant for PCs rather than NPCs. I present them here mainly so they can be disregarded and the DM can simply dispense with this process instead.
Option 1: Make the orphan take the feat Apprentice (DMG2 176)
Upon reaching level 3, the orphan takes this feat, selecting a PC as a mentor. The PC need not have the feat Mentor (DMG2 176), but won't get any of the benefits from being the orphan's mentor if he doesn't. In fact, it's probably funnier if the PC doesn't have the feat Mentor so the kid spends time training around the PC he's selected anyway, copying his moves, vying for his attention, and probably just making a nuisance of himself. That's fine, genre-appropriate, and gives the player an opportunity to assume the grizzled veteran role normally assumed by NPCs.
This is, I admit, an unusual reading of the feat Apprentice, which is intended for PCs rather than NPCs and reading the feat this way requires switching around much of the jargon associated with the description. It doesn't help that the description of the feats Apprentice and Mentor is deeply fiddly, likely to cause frustration and dismay, and goes on for five pages.
I don't recommend this option both because it's a bookkeeping headache and relies on a counterintuitive reading. Further, you'll probably eventually end up--if the DM doesn't handwave it away after reading those rules in the Dungeon Master's Guide II--using the option below anyway.
Option 2: Accompany the orphan on his Rebuilding Quest
The Player's Handbook II describes the processes of Retraining (192-5) and Rebuilding (196-9). These are usually options for players who have made regrettable character choices or want to play something different but want to keep the character's background. Retraining and rebuilding are usually used by high-level characters, but to rebuild one just goes on a DM-designed Rebuild Quest that
should excite and frighten players. It’s an adventure few characters would willingly embark upon and fewer still could survive. To make rebuilding an option at all levels of play, however, the degree of challenge must change according to the PCs’ level. (199)
Luckily, as the orphan is an NPC Commoner 1, the rebuild quest that the DM designs could be pretty short and--from the PCs' perspective--utterly tame. In fact, such a quest could reasonably be an encounter with the PCs.
I don't recommend this route either unless everyone's idea of fun is escorting the NPC scamp as he fights his way through dire rats with his dagger only at the end to emerge battered yet reborn as a 1st-level sorcerer.3
This is, of course, barring shenanigans like taking the commoner-only flaw Chicken Infested (Dragon #330 87) while simultaneously getting the skill Handle Animal to the point where the character rears and trains rocs. But optimizing commoners is an exercise usually better left theoretical.
Although this DM would lean toward may. If a character must expend his actions to keep alive another character, the other character has participated in the encounter, albeit to the party's detriment.
Note that the DM may rule that it's possible for the PCs to create encounters for the NPC. Traps are easiest, with a camouflaged pit trap (CR 1) (DMG 70) costing a weirdly-high-but-nonetheless-affordable 1,800 gp. A commoner who encounters such a trap 3-4 times (not, one hopes, in a row) gains a level. What encountering means in this context I leave to the imagination.
Okay, I admit, that could be fun once. Once.
Best Answer
Loyalty
DMG p. 93 describes a variant/optional rule for Loyalty. This is intended to be used for friendly NPCs and measuring how far away from betraying/leaving the party they are. It can be used the other way around - how far away they are from betraying their current masters/friends and becoming friends with the party. I have been using it recently for many NPCs and monsters.
You will have to adjucate how the rolls affect the loyalty, and that will certainly depend on the NPC's personality.
For example, a greedy, but brave, NPC might be easily influenced by the party offering him gold, but might get even more hostile by the party trying to intimidate them. Cowardly goblins, on the other hand, might get easily influenced by a good roll in "We will kill you if you don't help us."
Anyway, as far as I remember (especially from PHB, MM and DMG - might have missed XGtE things), there is no "easy" answer for that - it will depend on your (DM) own role-playing as the NPC.
Why are you fighting?
The more general answer is: you, as the DM, need to understand why is the NPC fighting? Then, it becomes easier to adjucate how actions that decrease that motivation will affect the NPCs. From my earlier examples, if your NPC is a mercenary fighting because he wants money, the party offering him gold will make him a lot less willing to fight. If the NPC fights only due to loyalty, persuading him that his master is a bad guy might work. If a member of his family is held hostage or being threatened, promising protection for that person should work better than threatening the person themselves, as a father might care more for his daughter than for himself.
Create real motivations for your NPCs and that should lead the way for how to role play them.