In normal math mode, subscripts and superscripts are placed ignoring math accents and the same should be with \prescript; unfortunately, mathtools doesn't exclude math accents from consideration when deciding the dimensions of the phantom to which the “prescripts” are attached to.
\documentclass{article}
\usepackage{mathtools,bm,xpatch}
\makeatletter
\def\remove@math@accents{%
\let\hat\@firstofone
% add the accents you need to cope with
}
\MHInternalSyntaxOn
\xpatchcmd{\MT_prescript_inner:}{{#3}}{{\remove@math@accents#3}}{}{}
\MHInternalSyntaxOff
\makeatother
\begin{document}
\[
\bm{f}(
\prescript{S}{E}{\hat{\bm{q}}},
\prescript{E}{}{\hat{\bm{d}}},
\prescript{S}{}{\hat{\bm{s}}}
)
\]
\end{document}

\documentclasscommand, have a minimal preamble and then\begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! – Aug 28 '16 at 10:59$$....$$-- that's deprecated. Use\[...\]– Aug 28 '16 at 11:16{}at the beginning of the "hatted" argument if that letter is tall. – barbara beeton Aug 28 '16 at 12:45\lefthere gives the wrong spacing, either use a specifically size bracket, such as\bigl(or precede the\leftwith\mathopen{}or use amathtoolspaired delimiter, see http://tex.stackexchange.com/q/2607/15925 – Andrew Swann Aug 28 '16 at 14:49