Depends on the pump.
The biggest issue is a plunger pump is "flow on fail" meaning the rotary vane pump in the IP can still suck fuel through a failed plunger type lift pump and the engine continues to run. Like the WALBRO FRC-10, and the factory lift pump. Gasoline pumps are usually roller vane or rotary vane and fuel stops flowing when the pump quits. You will notice about 2 seconds later when the engine sputters and quits after the pump.
Diesel is now mixed with Biodiesel and can limit the life of older diesel lift pumps due to trace amounts of Methanol left in the biodiesel. I suggest a
WALBRO FRC-10 LIFT PUMP from a supporting vendor. Trimmings are optional like the fittings, but, make life easier.
Gasoline pumps are designed for the lighter gasoline that diesel will drag the motor down on and can have seal issues on diesel/biodiesel. A Methanol rated pump is fine to run. The Methanol from Biodiesel can ruin brushes in fuel cooled motors.
Feel free to try a gasoline pump, but, make sure your AAA dues are paid up. Again, from my lift pump graveyard (Factory AC Delco, Autozone OEM type replacement Suckz, Mallory replaced brushes often, Carter rotary pump brushes trashed, Walbro...) I recommend the Walbro although they are not bullet proof. Walbro's have lasted me the longest.
Don't mind me, but I hate taking diesel baths from OEM lift pump failures and this is the reason better lift pumps are more expensive.