Ghani was present at the venue but was unharmed, according to his campaign chief.
Just hours later, an explosion struck near the US Embassy in Kabul but details on that blast were not immediately known.
No one immediately claimed responsibility for the attacks. The violence comes as Afghanistan faces presidential elections on September 28. The Taliban have warned that polling stations and election campaigns would be targeted.
In today's suicide attack, the bomber rammed his motorcycle packed with explosives into the entrance of the venue where Ghani was campaigning on the outskirts of the city of Charakar in northern Parwan province.
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.
Firdaus Faramarz, spokesman for the Kabul police chief, said there was no immediate information about casualties in the Kabul blast, which took place near Massood Square, a deeply congested intersection in the center of Kabul. NATO and US compounds are located nearby as are several Afghan government ministries.
Campaigning for the Afghan elections resumed last week after US President Donald Trump declared that the US-Taliban talks which have been going on for months in the Persian Gulf Arab state of Qatar are over.
Most presidential candidates had suspended their campaigns while negotiations were taking place and as the US peace envoy, Zalmay Khalilzad, said a deal was all but signed.
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.
Ghani, who had been sidelined during much of the talks between Khalilzad and the Taliban, resumed campaigning immediately and had been steadfast in his demand that presidential polls should take place.
Khalilzad and some of Ghani's rivals, however had talked of establishing an interim administration to run the country while a peace deal was implemented.
In the aftermath of the scrapped talks, Afghans braced for what many expected to be an increase in violence.
The Taliban have opposed the elections and have refused to meet with representatives of Ghani's government for talks. They have also refused to agree to a cease-fire.
But it was two attacks in Kabul in recent weeks that caused Trump to halt the negotiations with the Taliban, including one that killed two NATO soldiers, one of whom was an American. Another US soldier died in combat in Afghanistan on Monday.