The font used by mathptmx is a virtual font made up of times letters and assorted symbols from other fonts. The designers chose to take the comma from the cm font rather than the font used for letters.
So if you want a different choice the correct place to change that is in the fontinst files that set up the virtual font. But that's a bit of a black art so an alternative is to give , a definition in TeX to pick up text mode comma. If you need this to get smaller in subscripts load amsmath as well which will redefine \textrm.
\documentclass{article}
\usepackage{mathptmx}
\mathcode`,"8000
\begingroup
\lccode`\~`\,\lowercase{\endgroup
\def~{\mathpunct{\textrm{,}}}}
\begin{document}
\showoutput
\textit{a}$a$ (the \textit{a}'s are the same, hurray)
,$,$ (the commas are different, grumble)
\end{document}