While taking ghusl if there is oil in hair is it necessary to remove the oil and then take ghusl?

Yes it is necessary to remove it because it stops the water to reach.