Heat is a form of energy. There is a spontaneous flow from one object to another. The flow depends on difference of temperature between two object. Both oil burner and electric heater is producing heat but have different COP (coefficient of performance).
The COP is a ratio of useful heating or cooling provided. Higher COP is lower operating cost.
For burning oil and producing heat, combustion is not 100% as because partial burned oil will go through exhaust gas and will carry some heat. COP for oil or gas is never cross 0.9 rather less for old items.
Electricity is 100% efficient but has some resistance, inductive and capacitive loss. Mostly electricity comes form mechanical energy conversation and having a conversion rate of 48%. If the electricity is from a DC source loss is only resistive. If it is from an AC source, inductive and capacitive loss will be added but this loss is almost negligible.
Oil burner is using oil for producing heat. We can compare unit cost of oil to product certain amount of heat and compare those to electric cost . Electricity also have a unit cost. With a cost comparison we can determine which one is cost effective. Oil fired heater has a maintenance cost and electric heater has less.
In some of the country, oil price has a subsidy. In gulf and some of the oil enriched country, oil price is low as such heating cost also. However electric heating is clean and can be cost effective if has a proper unit cost.