U.S. President Donald Trump tweeted this claim on June 3, 2020.
It's false. Trump did not coin the nickname "Mad Dog" for retired Marine Corps General and former Secretary of Defense James Mattis. The general, who reportedly hates this nickname, has been referred to as "Mad Dog Mattis" in public reports since at least 2004. Los Angeles Times reported that the nickname originated with Mattis' troops:
Trump's claim that he and former President Barack Obama both fired Mattis has a little more truth to it.
Mattis served as the Commander of the United States Central Command under Obama until he was removed from the position in 2013 over his "hawkish" views on Iran. Mattis served as the U.S. Secretary of Defense under Trump, but he resigned in 2018 over Trump's decision to pull troops from Syria. Trump subsequently accelerated Mattis' resignation and now claims that the general was fired.
Additional context: Trump sent the above-displayed tweet the day following the publication of an op-ed by Mattis in which the general wrote: "Donald Trump is the first president in my lifetime who does not try to unite the American people — does not even pretend to try. Instead, he tries to divide us."