Mr Ghani was present at the venue but was unharmed, according to his campaign chief.
The Taliban claimed both attacks.
The violence comes as Afghanistan faces presidential elections on September 28 — a vote the Taliban vehemently oppose. The insurgent group has warned Afghans not to vote in the election, and said their fighters would target election campaigns as well as polling stations.
During Tuesday’s first attack, which took place in the northern Parwan province, the bomber rammed his motorcycle packed with explosives into the entrance of the venue where Mr Ghani was campaigning on the outskirts of the city of Charakar.
There were many women and children among the casualties, said Dr Qasim Sangin, a local official.
Wahida Shahkar, spokeswoman for Parwan’s governor, said the rally had just begun when the explosion occurred.
Local television footage of the attack showed twisted wreckage and charred remains of military and police vehicles that were apparently positioned near where the powerful blast occured.
Firdaus Faramarz, spokesman for the Kabul police chief, said there was no immediate information about any casualties in the Kabul blast, which took place near Massood Square, a deeply congested intersection in the centre.
Zabihullah Mujahid, a Taliban spokesman, released a statement to the media saying Taliban suicide bombers were behind both attacks.
In Parwan, Mr Mujahid said the bomber targeted presidential guards who were protecting Mr Ghani and the rally, along with other members of the security forces.
It was not immediately known if any of Ghani’s guards were among the casualties.
Mujahid claimed the suicide bomber in Kabul targeted an Afghan army base.
Late-night Taliban suicide attack in Kabul hours after US agrees deal to withdraw 5,000 troops from Afghanistan
Campaigning for the Afghan elections resumed last week after Donald Trump declared that the US-Taliban talks which have been going on for months in Qatar are over.
Most presidential candidates had suspended their campaigns while negotiations were taking place. The US peace envoy, Zalmay Khalilzad, said a deal was all but signed.
Mr Trump’s tweets at the beginning of September declaring the deal and the talks were “dead” launched the war-battered nation on an election campaign.
Mr Ghani, who had been sidelined during much of the talks between Mr Khalilzad and the Taliban, resumed campaigning immediately and had been steadfast in his demand that presidential polls should take place.
Mr Khalilzad and some of the preisdent’s rivals had talked of establishing an interim administration to run the country while a peace deal was implemented.
- Read more
In the aftermath of the scrapped talks, Afghans braced for what many expected to be an increase in violence.
The Taliban have refused to discuss a ceasefire and have stepped up attacks across Afghanistan. Meanwhile, Afghan forces, backed by their US allies, have intensified raids on militant hideouts in recent weeks.
The insurgent group have refused to meet with representatives of Mr Ghani’s government for talks but it was two attacks in Kabul in recent weeks that caused the US president to halt the negotiations with the Taliban, including one that killed two NATO soldiers, one of whom was an American.
Monday’s death was the 17th US combat death in Afghanistan this year, according to the Pentagon’s count.
There also have been three non-combat deaths this year. More than 2,400 Americans have died in the nearly 18-year war.
Support free-thinking journalism and attend Independent events
Even as the bombs went off in Afghanistan, the Taliban were on the move looking for support.
On Tuesday, the Afghan Taliban were in Iran visiting officials in Tehran, while last week they were in the Russian capital holding consultations with Zamir Kabulov, Vladimir Putin‘s envoy for Afghanistan.
Iran’s semi-official Borna news agency on Tuesday quoted spokesman of the foreign ministry there, Abbas Mousavi, as saying the Afghan delegation discussed “the latest” developments with Iranian officials.