You can use pgfmath facilities or l3fp.
\documentclass{article}
\usepackage{tikz,ifthen}
\begin{document}
\begin{tikzpicture}
\foreach \i in {1,...,12}{
\pgfmathsetmacro\test{mod(\i,3)==0}
\ifthenelse {\test=1}
{\draw[purple] (.75*\i,0) node () {\i};}
{\draw[blue] (.75*\i,0) node () {\i};}
}
\end{tikzpicture}
\begin{tikzpicture}
\foreach \i in {1,...,12}{
\edef\test{\fpeval{\i/3==trunc(\i/3)}}
\ifthenelse {\test=1}
{\draw[purple] (.75*\i,0) node () {\i};}
{\draw[blue] (.75*\i,0) node () {\i};}
}
\end{tikzpicture}
\end{document}

Or you can use a reimplementation of \ifthenelse.
\documentclass{article}
\usepackage{tikz}
% https://tex.stackexchange.com/a/467527/4427
\ExplSyntaxOn
\NewExpandableDocumentCommand{\xifthenelse}{mmm}
{
\bool_if:nTF { #1 } { #2 } { #3 }
}
\cs_new_eq:NN \numtest \int_compare_p:n
\cs_new_eq:NN \oddtest \int_if_odd_p:n
\cs_new_eq:NN \fptest \fp_compare_p:n
\cs_new_eq:NN \dimtest \dim_compare_p:n
\cs_new_eq:NN \deftest \cs_if_exist_p:N
\cs_new_eq:NN \namedeftest \cs_if_exist_p:c
\cs_new_eq:NN \eqdeftest \token_if_eq_meaning_p:NN
\cs_new_eq:NN \streqtest \str_if_eq_p:ee
\cs_new_eq:NN \emptytest \tl_if_empty_p:n
\cs_new_eq:NN \blanktest \tl_if_blank_p:n
\cs_new_eq:NN \booleantest \legacy_if_p:n
\cs_new:Npn \modetest #1
{
\str_case:nnF { #1 }
{
{h}{\mode_if_horizontal_p:}
{v}{\mode_if_vertical_p:}
{m}{\mode_if_math_p:}
{i}{\mode_if_inner_p:}
}
{\c_false_bool}
}
\cs_new:Npn \enginetest #1
{
\str_case:nnF { #1 }
{
{luatex}{\sys_if_engine_luatex_p:}
{pdftex}{\sys_if_engine_pdftex_p:}
{ptex}{\sys_if_engine_ptex_p:}
{uptex}{\sys_if_engine_uptex_p:}
{xetex}{\sys_if_engine_xetex_p:}
}
{\c_false_bool}
}
\ExplSyntaxOff
\begin{document}
\begin{tikzpicture}
\foreach \i in {1,...,12}{
\xifthenelse {\fptest{\i/3==trunc(\i/3)}}
{\draw[purple] (.75*\i,0) node () {\i};}
{\draw[blue] (.75*\i,0) node () {\i};}
}
\end{tikzpicture}
\end{document}
For the \xifthenelse version, you can also add a user level function for the modulo operation: add
\cs_new_eq:NN \IntMod \int_mod:nn
just before \ExplSyntaxOff and the test can become
\xifthenelse{\numtest{\IntMod{\i}{3}==0}}