The France international, 32, moved to Shanghai Shenhua last January from Champions League winners Chelsea, scoring three goals in 22 matches.
Anelka is reported to be keen to terminate his contract with the Chinese side, prompting speculation the former Arsenal striker could join Queens Park Rangers or West Ham United.
“He only asked to train. He played under me and we are friends now. I allowed him to train because of our friendship,” said Ancelotti.
QPR manager Harry Redknapp expressed an interest in signing Anelka last month – but the 65-year-old admitted the west London club could struggle to afford the striker’s wages.
“I think he is finishing in China so he is available,” said Redknapp.
“He is a top player so we would be interested, but whether we could afford to get anywhere near him I’m not sure.
“It is what you can do, whether you can afford these players, what they are looking for, whether they are reasonable, whether you can deal with them and most importantly whether you think they can do the job you want.
“I think the chairman knows Nicolas’s people and that so has got a few details on what it would be.
“It depends, just how expensive the whole package comes to. If it is within reason, he is a player that could certainly improve your team.”
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news