\RequirePackage{filecontents}
\begin{filecontents*}{data.csv}
name
first
dsdd
second
third
fourth
fifth
\end{filecontents*}

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{datatool}

\DTLloaddb{sample}{data.csv}

\begin{document}

\begin{tabular}{c}
% \rowcolor{orange}%
  \textbf{name}
  \DTLforeach{sample}{\word=name}{%
    \\
    \DTLifstringeq{\word}{second}{\rowcolor{red}}{} % Does not work
%     \rowcolor{yellow}                               % Works
%     \DTLifoddrow{\rowcolor{green}}{}                % Works
%     \DTLiffirstrow{\rowcolor{blue}}{}               % Works
%     \DTLiflastrow{\rowcolor{orange}}{}              % Works
    \word
  }
\end{tabular}

\end{document}
