President Donald Trump’s legal team has been studying a 1990s federal court ruling that could be the basis for delaying, limiting or avoiding an interview with special counsel Robert Mueller, who is heading an investigation into Russian interference in the 2016 election, according to people familiar the matter.

Mr. Trump this week told reporters he was “looking forward” to speaking to the special counsel’s office, which has already interviewed more than 20 members of his White House staff.

“I would love to do it, and I would like to do it as soon as possible,” the president said.

Yet he also said that any decision about testifying before prosecutors looking into possible obstruction of justice on his part would be “subject to my lawyers,” whose interest is to spare Mr. Trump any legal jeopardy.

Mr. Mueller’s investigation is looking into whether the Trump campaign colluded with Moscow during the campaign and whether the president obstructed justice when he fired former FBI Director James Comey, who initiated the probe.