"I hope I can play football for many, many years," he said, when asked if he'd like to try La Liga after featuring in the Premier League and Serie A. "Why not? You never know what's going to happen in the future, so maybe one day, yes."
Asked whether his four-year stint at Anfield was coming to an end, Salah added: "It's not up to me. Let's see what will happen, but I prefer not to talk about it now."
The 28-year-old has scored 17 Premier League goals this season as Liverpool have struggled to match the form that saw them end a 30-year wait to be crowned champions in 2019-20. They are seventh in the Premier League table, 25 points behind leaders Manchester City.
Salah has history with Madrid, after a challenge from Sergio Ramos saw him forced off with a dislocated shoulder half an hour into the 2018 Champions League final, which Los Blancos went on to win 3-1.
"Let's say I have a special desire to win the game and to qualify for the semifinals," Salah said. "But whatever happens now isn't going to change the result in Kiev. That's over... That game is already gone. It's about the team. Everybody wants his team to win. That's it."
Liverpool bounced back from that defeat to win the Champions League a year later, beating Tottenham Hotspur in the 2019 final in Madrid.
By contrast, Madrid have since found life difficult in Europe, being eliminated in the round of 16 two years in a row.
"It's different," Salah said, when asked how this Madrid team compares to the 2018 side. "They lost some great players, Cristiano [Ronaldo], one of the best in history, they lost someone scoring a lot of goals.
"They signed [Eden] Hazard, and he was unlucky with injuries. The team now is still in the quarterfinals without this great player. They lost goals from Ronaldo. I can't say which one is better."
Madrid host Liverpool in the first leg of their quarterfinal clash on Tuesday April 6, before the return leg at Anfield on April 14.