It would not be a safe choice to burn #2 diesel fuel in a kerosene heater. It is not clean and would wreck your heater. However, #1 diesel fuel and kerosene are the same thing and can be used interchangeably.
You can use diesel fuel in a kerosene heater as diesel is essentially a heavy version of Kerosene. The downside to such an arrangement is that it would emit more smoke than kerosene and clog up the wick faster.