A bad distributor could cause an engine to misfire or stall if the distributor is not turning correctly with the engine and gets out of time.
The distributor must be set correctly in time for the engine to get the correct amount of spark at the exact time it's needed.
Sometimes if a distributor is not bolted down tight enough it could jump out of time.
Most times though it's not the distributor but instead the cap and rotor causing the stalling problems.
Other things that could cause your engine to stall are bad spark plugs, plug wires, bad ignition coil and even fuel delivery problems such as low fuel pressure or clogged fuel filter.