Saturday's attack was the latest on foreign forces. It occurred near the gates of the base in the western city of Herat, near the border with Iran, which is home to hundreds of Italian soldiers.
Mohammed Ayub Salingi, the police chief, said a suicide attacker drove a vehicle up to the gates of the base and detonated explosives inside the car.
One of the dead was an Afghan guard at the base, while the other was a passer-by, he said. The attacker also died.
Warrant Officer Cosimo Argentieri, a spokesman for the Nato force, confirmed the blast and said no foreign troops were killed.
He said one foreign civilian inside the base was slightly wounded on an arm.
On Friday a suicide attack occurred outside a US-led coalition base in Laskargah, the main town in Helmand. It wounded two US military service members and one US civilian contractor.
Taliban insurgents fighting to expel foreign troops and overthrow the Western-backed government have unleashed a wave of violence in recent weeks, including attacks on military bases, ambushes and roadside and suicide bombings.