This is a contentious issue which is addressed in Dungeons and Dragons 3.5 only by the Main D&D FAQ and, as of this writing, in Pathfinder only by commentary from creative director James Jacobs. I've done my best here to present information rather than take a side.
Maybe in Dungeons and Dragons 3.5...
If ignoring the Main D&D FAQ (see below), one reading is that a rogue that takes the special ability skill mastery can pick to master the skill Use Magic Device and thereafter take 10 on Use Magic Device skill checks. This is because the special ability skill mastery allows the rogue take 10 on skills under adverse conditions, and the skill Use Magic Device is always employed under adverse conditions that skill mastery allows the rogue to ignore. This reading—and an alternative to it—is detailed below.
The Player's Handbook on Taking 10 says
When your character is not being threatened or distracted, you may choose to take 10. Instead of rolling 1d20 for the skill check, calculate your result as if you had rolled a 10. For many routine tasks, taking 10 makes them automatically successful. Distractions or threats (such as combat) make it impossible for a character to take 10. (65)
And the rogue's special ability skill mastery says
The rogue becomes so certain in the use of certain skills that she can use them reliably even under adverse conditions. Upon gaining this ability, she selects a number of skills equal to 3 + her Intelligence modifier. When making a skill check with one of these skills, she may take 10 even if stress and distractions would normally prevent her from doing so.1 (51)
And the skill Use Magic Device simply says, "You cannot take 10 with this skill." (86).
Unlike taking 10 on Swim skill checks in stormy water—which creatures can't do "even if [they] aren’t otherwise being threatened or distracted" (84)—, the skill Use Magic Device provides no explanation as to why a creature can't take 10 on it. Absent that, the default explanation for being unable to take 10 appears to apply, and, as per Taking 10, that's distractions and threats (or "stress"), and those adverse conditions are covered by skill mastery.2
Narratively, then, even if not in immediate danger, everything is distracting when making a Use Magic Device skill check, so taking 10 on Use Magic Device skill checks usually can't be done. Fortunately for the rogue, the special ability skill mastery grants certainty sufficient to overcome distractions, allowing a creature that masters the skill Use Magic Device to take 10 with that skill.3
A reasonable alternative reading
A different reading is that because the skill Use Magic Device doesn't say why a creature can't take 10, it's unclear if what's preventing a creature from taking 10 on Use Magic Device skill checks is distractions, stress, or another adverse condition, or if, for example, it's the alignment of the planets, mischievous spirits, the will of the gods, or no reason at all. Such a reading means the special ability skill mastery can't apply to the skill Use Magic Device because it's unknown why a creature can't take 10—it just can't.4
...But No in 3.5 according to the Main D&D FAQ
The Main D&D FAQ includes the following exchange:
Question: Can a rogue with skill mastery take 10 on a Use Magic
Answer: No. The rogue’s skill mastery class feature states that “she can take 10 even if stress and distractions would normally prevent her from doing so.” This only applies to skills that allow a character to take 10 in nonstressful situations; if a skill simply doesn’t allow a character to take 10 under any circumstances (such as Use Magic Device), skill mastery provides no benefit. (24)
Keep in mind, though, that some folks take issue with the FAQ's rulings.5
No in Pathfinder
Many of the Pathfinder arguments for and against being able to take 10 with a mastered Use Magic Device skill mirror those of D&D 3.5: danger and distractions prevent taking 10, skill mastery remains largely unchanged, the skill Use Magic Device still says a creature can't take 10 with it, and so on.
However, creative director James Jacobs had this 2014 exchange:
User's Question: Skill Mastery reads she may take 10 even if stress and distractions would normally prevent her from doing so. Use Magic Devices reason for not taking being able to take 10 on UMD is not dependent on Stress or Distraction however because of the way the sentence is structured it can be interpreted two ways. Can you take 10 on Use Magic Device with Skill Mastery?
Jacobs's Answer: You can't take 10 with Use Magic Device using Skill Mastery, since the reasons you can't normally take 10 with that skill aren't due to stress or distraction. You need a specific and unique ability to take 10 on Use Magic Device (such as one of the abilities possessed by 3.5's warlock class).
Also, this Paizo 2015 thread on this issue has at least 28 votes as a FAQ candidate (now—click!—29).6 Less active threads raised the same issue in 2010, 2011, 2012, and 2014 (and marked as a FAQ candidate—click!—25 times). It should come as no surprise that some of these threads reach conclusions that contradict each other. Thus far, though, Jacobs's exchange is the last word players have received.
Yes in D&D 3.5 and Pathfinder... syntactically, anyway
As KRyan's answer details, examining skill mastery's syntax may make a difference in how the special ability works in your campaign. To reiterate, the special ability skill mastery in D&D 3.5 and Pathfinder says
The rogue becomes so certain [in Pathfinder, confident] in the use of certain skills that she can use them reliably even under adverse conditions.
Emphasis mine. Compare that emphasized clause to these similar sentences:
- Abe can drink healing potions quickly even when healthy.
- Bill can cast magic missile spontaneously even underwater.
- Cass can draw her sword aggressively even on horseback.
But Abe can drink healing potions quickly when he's unhealthy, Bill can cast magic missile spontaneously on land, and Cass can draw her sword aggressively when infantry instead of cavalry. The phrase following even presents unexpected information, but the phrase following even neither limits nor negates the original clause.
Thus, "[S]he can use them reliably even under adverse conditions," should mean that she can use them reliably all the time and—surprise!—that includes under adverse conditions. It should not mean that she can use them reliably only under adverse conditions yet other undefined circumstances impede their reliable use. (The later even if in skill mastery is still more precise.)
This argument is rarely made, however. The turn of phrase goes largely ignored in discussions of skill mastery even by a FAQ entry author and a Pathfinder developer.
1 Compare to the feat Hardened Criminal's benefit allowing the creature to take 10 on one picked skill "even under conditions when taking 10 would normally be impossible" (City of Stormreach 95). Thus if the picked skill is Use Magic Device the DM must decide if that includes The game says you can't.
2 Taking 10 on a Swim skill check in stormy water is unusual, however. Obviously, stormy water fits almost any definition of skill mastery's adverse conditions, but taking 10 on a Swim skill check in stormy water is not enabled by immunity to distractions and threats (or "stress"). This means, as detailed above, there's a reading that says that, rather than the DM needing to decide if a creature possessing skill mastery can take 10 on Use Magic Device skill checks, the DM instead must decide if such a creature can take 10 on Swim skill checks in stormy water, which is, fortunately, in many campaigns a much rarer occurrence.
3 This jibes with the warlock's extraordinary ability deceive item, which says, "When making a Use Magic Device check, a warlock can take 10 even if distracted or threatened" (Complete Arcane 8). (But also see footnote 5.)
4 Were I player in such a DM's campaign, I'd accept such a ruling without complaint, but I'd raise the issue before opting to play a rogue (or other class that gains skill mastery), and I'd be disappointed by the ruling were I considering playing a rogue in a party otherwise composed of a cleric, a druid, and a wizard (and why I'd be considering playing a rogue in such a group instead of, like, a sorcerer is another question altogether). But it's still a reasonable ruling.
5 As an aside, the Main D&D FAQ addresses the warlock's deceive item extraordinary ability:
Question: The warlock’s deceive item class feature (CAr 8) allows
him to take 10 on Use Magic Device checks “even if distracted or threatened,” but the Use Magic Device skill says you can’t ever take 10, regardless of distraction. Does deceive item also let the warlock ignore this restriction?
Answer: This class feature really does two things. First, it allows the warlock to take 10 on Use Magic Device skill checks (a boon all by itself). Second, it allows him to take 10 on such checks even in conditions where that would normally not be possible. (28)
But this is problematic if comparing the texts of skill mastery and deceive item (see footnote 3).
6 I was unaware of that thread when composing the 3.5 portion of this answer. It's interesting reading for both games.