If you want necessarily to use \dfrac with the minus sign you add \ooalign.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
\[e^{-\frac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\[e^{\ooalign{$-$}\dfrac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\end{document}
Addendum: Using the comment of @campa with \hbox you obtain the same result.
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
\[e^{-\frac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\[e^{\hbox{$-$}\dfrac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\end{document}

Update 2022-04-14
Based on the discussions from this question, I propose to use \mbox instead of \hbox.
The main difference is that using \hbox in LaTeX can lead to
unexpected results. So always use the latter, unless you know what
you're doing with \hbox.
-- egreg
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
default: \[e^{-\frac{(x-\mu_2)^2}{2\sigma^2_2}}\]
hbox: \[e^{\hbox{$-$}\dfrac{(x-\mu_2)^2}{2\sigma^2_2}}\]
mbox: \[e^{\mbox{$-$}\dfrac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\end{document}

\dfracin a superscript is probably excessive, you could set the whole superscript, including the - in\displaystylerather than the default\scriptstyleor use\expnotion rather thane^{..}so the expression is not in a superscript – David Carlisle Mar 20 '22 at 19:51