Mr Hamdallah was not harmed in the incident on Tuesday morning near Beit Hanoun, shortly after crossing into the Hamas-controlled area. Pictures form the scene showed three vehicles were damaged, with their windows blown out and streaks of blood on a car door.
Unconfirmed local reports said the blast was an IED and that seven people had been lightly hurt. Hamas' interior ministry said there were no injuries.
The West Bank's Palestinian Authority quickly accused militants in Gaza of trying to kill the premier in an assassination attempt. It said Hamas had not provided adequate security.
The security services have begun an investigation into the incident, according to Hamas' interior ministry spokesperson Eyad Al Bozom. A tweet from the interior ministry condemned the attack as a "crime".
Mr Hamdani was travelling to the coastal enclave to inaugurate a sewage plant project. He gave a speech at the site as scheduled just minutes after the explosion, appearing unshaken and unharmed, although he said the rest of his visit would be cut short.
"There is a big plot against us all," the premier said. "What happened today strengthens our determination to achieve reconciliation. I will return to the Gaza Strip."
Access to reliable and safe drinking water is one of the Gaza Strip's most pressing issues. The area has suffered from an effectively collapsed economy, chronic lack of electricity and several rounds of fighting with Israel since Hamas seized control in 2007, leading to an Egyptian-Israeli blockade of its borders.
The plant has been made possible thanks to $75m (£54m) in funding from the World Bank, European Union and other European governments.
Relations between Hamas and the Palestinian Authority have recently improved: the two rival Palestinian leaderships signed a reconciliation deal in October last year and agreed to hold elections by 2019.
There remain major disagreements, however, on how to implement certain elements of the deal, such as border controls.
Prime Minister Rami Hamdallah has held the position since 2013. This is believed to be the first alleged attempt on his life.
More about: Gaza