\documentclass{article}
\begin{document}
\begin{tabular}{ll|l}
? & $\mathaccent'27{u}_s$\\
$\acute{a}$ & $\mathaccent"7013{a}$ & $\acute{abc}$\\
$\bar{a}$   & $\mathaccent"7016{a}$ & $\bar{abc}$\\
$\breve{a}$ & $\mathaccent"7015{a}$ & $\breve{abc}$\\
$\check{a}$ & $\mathaccent"7014{a}$ & $\check{abc}$\\
$\ddot{a}$  & $\mathaccent"707F{a}$ & $\ddot{abc}$\\
$\dot{a}$   & $\mathaccent"705F{a}$ & $\dot{abc}$\\
$\grave{a}$ & $\mathaccent"7012{a}$ & $\grave{abc}$\\
$\hat{a}$   & $\mathaccent"705E{a}$ & $\hat{abc}$\\
$\tilde{a}$ & $\mathaccent"707E{a}$ & $\tilde{abc}$\\
$\vec{a}$   & $\mathaccent"017E{a}$ & $\vec{abc}$\\
            & $\mathaccent"7017{a}$ \\
$\widetilde{aaa}$   & $\mathaccent"0365{aaa}$ \\
$\widehat{aaa}$     & $\mathaccent"0362{aaa}$ \\
\end{tabular}

\def\abc{ABC}
\def\nothing{}
Test what arguments hat accepts
(should be same with check, breve, acute, grave, tilde, bar, vec,
dot, ddot, overline, widehat, widetilde)
\let\testmacro\hat
\[ [\testmacro A] \quad
 [\testmacro{}] \quad
 [\testmacro{A}] \quad
 [\testmacro{ABC}] \quad
 [\testmacro\nothing A] \quad
 [\testmacro\relax A] \quad
 [\testmacro\noexpand\relax A] \quad
 [\testmacro{\verb+$+}] \quad
 [\testmacro\bgroup A \egroup] \quad
 [\testmacro\bgroup \verb+$+ \egroup] \]
Note that this only accents the A
\[ [\testmacro\abc] \]

Other accent-like macros (underbrace, overbrace) only accept regular style arguments
\let\testmacro\underbrace
\[ [\testmacro A] \quad
 [\testmacro{}] \quad
 [\testmacro{A}] \quad
 [\testmacro{ABC}] \quad
 [\testmacro\abc] \]
But note that while these don't fail, they accent nothing
\[ [\testmacro\nothing A] \quad
   [\testmacro\relax A] \quad 
 [\testmacro\noexpand\relax A] \quad 
 [\testmacro\leavevmode A] \]
And a peculiar case
\[ \expandafter\testmacro\testmacro foo \]

\end{document}