Of course he can.
President Trump can’t fire Robert Mueller on his own under the terms of Mueller’s contract, but the attorney general does have that authority. If the president wanted Mueller gone, then, he could simply instruct attorney general Jeff Sessions to fire him.
At that point, Sessions would have to decide whether this duty should rest with him or whether it should be up to Deputy Attorney General Rod Rosenstein. Sessions has recused himself from the Russia investigation, and so the decision of whether to fire Mueller should go to Rosenstein.
It would then be up to Rod Rosenstein, the man who hired Mueller in the first place to decide whether he should comply with the presidents orders and fire the special counsel. While the president could not bypass Rosenstein and fire Mueller himself, he could fire Rosenstein and replace him with a deputy attorney general who will agree to fire Mueller.
In fact, this is precisely what happened under President Richard Nixon in October 1973 in what has come to be known as the Saturday Night Massacre. Nixon wanted to fire Archibald Cox, the independent prosecutor who was investigating Watergate. He ordered his attorney general, Elliot Richardson, to fire Archibald Cox, but Richardson refused and instead resigned. Nixon then ordered the deputy attorney general, William Ruckelshaus, to fire Cox. Ruckelshaus also refused and resigned. Solicitor General Robert Bork was subsequently sworn in as attorney general, and Bork was finally the one to fire Cox.
President Trump, then, only has the power to order his subordinates to fire Robert Mueller, but if they were to refuse, he could simply replace them with someone who would follow his orders and fire Mueller.
However, Trump firing Robert Mueller would be such an extraordinary turn of events that it would almost certainly lead down the road to impeachment.
Firing an independent counsel would be seen in Congress as an attempt to interfere with the ongoing investigation into Russias role in the 2016 election.
It was a massive mistake, but it is too late now.