\documentclass{minimal}
\usepackage{unicode-math}
\begin{document}
\setmathfont{Cambria Math}
\def\hat{\Umathaccent fixed 0 4 "0302 }
\def\widehat{\Umathaccent 0 4 "0302 }
$\hat x \hat M \hat 0 \hat + \widehat{abc}$ \par
\setmathfont{XITS Math}
\def\hat{\Umathaccent fixed 0 4 "0302 }
\def\widehat{\Umathaccent 0 4 "0302 }
$\hat x \hat M \hat 0 \hat + \widehat{abc}$
\end{document}
% Local Variables:
% TeX-engine: luatex
% End:
