% All possible sizes of the various mathdots tested
\documentclass{article}
%\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{mathdots}
%
% \dddot and \ddddot are wider in mathptmx package.
% Since there is no way to get a measure of the actual separation
% between dots in the 2-dot accent, I have made the spacing
% commands available to the user. The following seem to work well
% for mathptmx:
%\MDodotkern=-2mu
%\MDoprekern=-1mu
%\MDopostkern=0mu
\newcommand\testdots{%
$\ddots^{\ddots^{\ddots}}$ $\iddots^{\iddots^{\iddots}}$
$\vdots^{\vdots^{\vdots}}$
\par
$\dot{X}
\ddot{X}
\dddot{X}
\ddddot{X}
X^{\dot{X}}
X^{\ddot{X}}
X^{\dddot{X}}
X^{\ddddot{X}}
X^{X^{\dot{X}}}
X^{X^{\ddot{X}}}
X^{X^{\dddot{X}}}
X^{X^{\ddddot{X}}}$
\par\smallskip\hrule\smallskip}

\setlength\textwidth{6.664in}
\setlength\oddsidemargin{-.082in}
\setlength\parindent{0pt}

\setlength{\textheight}{8.9in}
\setlength{\topmargin}{0pt}
\addtolength\headheight{3.06pt}
\addtolength\topmargin{-\headheight}
\addtolength\topmargin{-\headsep}

\begin{document}
\pagestyle{headings}
\tableofcontents
\clearpage

\section{Testing in headers and TOC:
    $\ddots$, $\vdots$, $\iddots$, $\dddot{X}$ and $\ddddot{X}$}

\tiny tiny \testdots
\scriptsize scriptsize \testdots
\footnotesize footnotesize \testdots
\small small \testdots
\normalsize normalsize \testdots
\large large \testdots
\Large Large \testdots
\huge huge \testdots
\Huge Huge \testdots

\end{document}