There are two possible scenarios.
One would be using diesel in a spark ignition engine.
This is common in parts of the world where diesel is more readily available than gasoline, like Cuba.
You start the engine on gasoline and then switch to diesel after it warms up. This works with old, low compression engines.
It might not work as well with more modern engines, since diesel has very low octane.
The second possibility would be a compression ignition engine using gasoline as a fuel. This has been tried as well and there is some serious work going on to evaluate such designs for production.
Of which were you thinking?