The Bernabeu legend believes the careless nature in which the Argentine is being looked after could lead to the club's fierce rival tempting him to the capital.
Transfers between the arch-rivals are rare, with Javier Saviola the only player to have moved between the two clubs in the past 14 years when he left Barca for Madrid in 2007.
Sanchez, who starred up front for the Blancos between 1985 and 1992, suspects the Argentine is not pleased with his current deal, which runs until 2018 and contains a buyout clause set at 200 million euros.
"Messi is not feeling valued highly enough by Barcelona with his contract and they must be careful," he told Bein Sport. "If Barca are careless, I can see Real Madrid signing him."
Messi has been with the Blaugrana since 2000 and has lifted the Ballon d'Or four times at the age of just 26.