Priority should be to stop on the paved surface, with enough of it around the aircraft to facilitate evacuation, fire crew access, etc.
Then consider the orientation of the main structure with respect to the source of the fire and its likely propagation.
If it is indeed an engine fire, it would be helpful to put as much as possible of the structure upwind of the engine. The actual direction and amount of turn will depend on the location of the engine, the size of the aircraft and, of course, the wind direction.
As most modern Boeings and all Airbus have wing-mounted 'pitot' installations for the engines, it is useful to have a quick 'rule of thumb' to help in the stressful few seconds after the event.
Taking off with a headwind component? Turn towards the fire.
Taking off with a tailwind component? Turn away from the fire.
Even I can remember that!
With rear fuselage-mounted engines (MD-80, 727 and most bizjets) it may be better to stop with the nose directly into wind.
With piston twins and singles (apart from pusher config) it will be best to stop with the tail directly into the wind.
This class of aircraft is small enough to accomplish this on most runway widths.
The few seconds that it takes may buy the occupants some valuable extra time in which to escape.
I agree that with fires resulting from pooling and/or flowing fuel, it is more complicated and it may be difficult to recognise the optimum orientation.
In a serious fire that is rapidly taking hold, the priority must be to just stop and get everyone off. Getting information about the location, nature and extent of the fire is vital when forming a picture of what is happening and deciding what to do.