Sure Obama can sue Trump for defamation. Libel is a civil offense and committing libel is not a part of Trump's role as president. Regarding official acts, the President is immune. But not for personal acts. See Is the US President immune from civil lawsuits?
But a libel action would be difficult to win; they're both public figures, which makes the defamation threshold higher:
Public officials and figures have a harder time proving defamation.
The public has a right to criticize the people who govern them, so the
least protection from defamation is given to public officials. When
officials are accused of something that involves their behavior in
office, they have to prove all of the above elements of defamation and
they must also prove that the defendant acted with "actual malice."
Defamation Law Made Simple | Nolo.com
The "actual malice" part is interesting:
In the landmark 1964 case of New York Times v. Sullivan, the U.S.
Supreme Court .... acknowledged that in public discussions --
especially about public figures like politicians -- mistakes can be
made. If those mistakes are "honestly made," the Court said, they
should be protected from defamation actions. The court made a rule
that public officials could sue for statements made about their public
conduct only if the statements were made with "actual malice." "Actual
malice" means that the person who made the statement knew it wasn't
true, or didn't care whether it was true or not and was reckless with
the truth -- for example, when someone has doubts about the truth of a
statement but does not bother to check further before publishing it. (same link above)
Could malice be proved? Was Trump reckless with the truth? Could be.
But would Obama sue? What's the cost/benefit analysis to him and his legacy, politically and personally?
Trump was taking a political or personal risk - or he's being stupid - with such accusations, since he may feel invulnerable. He has sued and been sued and settled many times: see Legal affairs of Donald Trump
I think both would not want to be in court; because once in court, they (and their lawyers) both have subpoena power and both would have to answer nearly any question put to them about their public (and possibly private; but not official) lives.
Trump has interestingly enough talked about "opening up the libel laws" so he can more easily sue people. But if he did that, it cuts both ways: he would be easier to take to court. See Can Libel Laws Be Changed Under Trump?
In my opinion, Obama is much better off ignoring Trump and letting the FBI, DOJ, Congress and the Intel Community do their jobs - have the facts fall where they may - and and not become a right-wing talk radio subject for the rest of his life, as well as risk being deposed himself in court.
From a timely piece in The New Yorker: http://www.newyorker.com/news/news-desk/how-the-first-amendment-applies-to-trumps-presidency
While it is unlikely that former President Barack Obama would sue
Trump for libel, he very likely has a strong case. The First Amendment
scholar Geoffrey Stone wrote in the Chicago Sun-Times http://chicago.suntimes.com/opinion/opinion-trump-could-lose-lawsuit-for-libeling-obama/ that “there
seems no doubt that Trump’s statement was false, defamatory, and at
the very least made with reckless disregard for the truth.” That is
the test for damaging the reputation of a public figure or official:
Trump either made his assertions with knowledge of their falsity or
with disregard of a high degree of probability that they were false.
Obama, Stone is confident, could prove that Trump made his false
charge, as the Supreme Court defined the standard, with “actual