Deputy AG Rod Rosenstein hired Mueller, so only he or Sessions can fire Mueller directly. Trump could order Rosenstein to fire Mueller, but Rosenstein would likely refuse. Trump could fire Rosenstein, and order the next-highest ranking Deputy AG to fire Mueller. Again, that Deputy AG would likely refuse, and so on. Alternatively, Trump could normally order AG Sessions to fire Rosenstein, but Sessions has recused himself from all matters related to the Russia investigation, so he can’t fire Mueller. Trump could fire Sessions for that refusal (after all, Sessions intervened in Comey’s firing, so his recusal isn’t absolute), but Congress has to approve the next AG, and it won’t approve a Trump loyalist (Giuliani has zero chance of being confirmed). In addition, firing the AG brings its own set of problems, notably a move to impeach Trump in order to protect themselves. Remember, once Sessions is a private citizen, the special prosecutor can threaten him with jail for his documented perjury during both his confirmation hearing and his Senate testimony. If I were Sessions in that situation, I’d choose to cooperate with the special prosecutor rather than go to jail.
Remember, too, that firing a special prosecutor began the swift downfall of President Nixon.