Use \coordinate (x\the\value{xi}) at (1,2);. The following shows that the two nodes were indeed created by the multiple calls to \foo{}:

Reference:
Notes (thanks to @GonzaloMedina):
- There is no need to set the counter to 0 - that is automatically done when creating a new counter.
- The definition of
\foo could also be given like this: \newcommand{\foo}{\stepcounter{xi}\coordinate (x\the\value{xi}) at (1,2);}.
- No need to invoke
\foo with an ending semicolon.
Having said that my personal preference is to initialize counters (programming habit), and to add a trailing ; within tikzpicture after each statement. I would not normally terminate the definition of \foo with a ; in which case the trailing ; would be required.
Code:
\documentclass{standalone}
\usepackage{tikz}
\newcounter{xi}
\setcounter{xi}{0}
\newcommand{\foo}[0]{
\addtocounter{xi}{1};
\coordinate (x\the\value{xi}) at (1,2);
}
\begin{document}
\begin{tikzpicture}
\foo{};
\foo{};
\node [circle, minimum size=3pt, inner sep=3pt, fill=blue ] at (x1) {};
\node [circle ,minimum size=6pt, inner sep=6pt, fill=red, fill opacity=0.5] at (x2) {};
\end{tikzpicture}
\end{document}
\coordinate (x\the\value{xi}) at (1,2);? See What is the proper method of accessing a counter?. Is that what you are looking for as I am not sure exactly what you want to accomplish. And thanks for providing a MWE. – Peter Grill Mar 28 '12 at 21:30