Pig’s fat is like its meat which is forbidden as Allah says :

Prohibited to you are dead animals, blood, the flesh of swine.[Quran 5 : 3 ]

It is therefore not allowed to eat its meat, fat, or anything that is cooked with the fat. This is applicable in a normal condition where he has freedom to choose from other different permissible foods, and nobody is putting pressure on him. However, If no other meat is found except that of pig meat or what is prepared by its oil (as in frying or cooking) or If it is taken under the influence of someone who is more powerful than him, eating it is acceptable. This is indeed a case of necessity, and necessity permits the forbidden. 

This is in accordance with the word of Allah :

But whoever is forced [by necessity], neither desiring [it] nor transgressing [its limit], there is no sin upon him. Indeed, Allah is Forgiving and Merciful.[Quran 2 : 173 ]

Moreover, the verdict regarding exigency is ascribable to all the forbidden mentioned in the verse. The word “Al-Makhmasah” indicates extreme hunger, and the word “Tajanuf” means the excess of the minimum in eating, or it is disobedience in travel, according to the differences of the jurists in this.

However, the verse is pointing to the eating of pig meat or its fat (oil) under necessity on condition that it will not exceed what will withhold last breath. For indeed the coercion is measured by its extent/degree. 

Also if someone is on the journey and he finds nothing (to eat) except the pig meat or what is prepared by its fat. It is permissible for him to eat from it – an amount necessitated by exigency-until he gets to where there is permissible food.