An airliner experiencing an engine fire might dump fuel, but not to starve the engine. That is much more easily accomplished by simply shutting down the fuel pumps to that engine, which would be a first-line firefighting technique as it's the most economical and the most likely to allow for a restart (less maintenance is required on an engine that's simply shut down versus one that's been doused with chemical suppressors, and those same chemical suppressors might extinguish the fire but would also inhibit relighting it).
There are several redundant fuel shutoff systems in most airliners, from the fuel pumps themselves to actual shutoff valves in the fuel lines in case the pumps themselves are the failure point. Any failure that would completely prevent the crew shutting off the fuel supply to a damaged engine would likely create much more immediate problems, like severe structural damage to the wing or fuselage of the aircraft. All of these shutoffs in addition to active fire suppression systems such as chemical extinguishers are under the flight crew's manual control; an engine on fire is usually still producing at least some thrust, which may be more important than extinguishing the fire in certain critical phases of flight.
The plane is more likely to dump fuel if it's close to its departure airport when the emergency occurs. In such a scenario, the aircraft is likely above its maximum landing weight (which is less than the max takeoff weight as the forces on the landing gear and the runway are less on takeoff than for landing and the plane is expected to burn most of its fuel weight by the time it gets where it's going), and therefore the fuel dump is simply to reduce the aircraft's weight for an emergency landing, so the landing gear doesn't collapse on touchdown. Additionally, if anything else goes wrong during the landing, dumping fuel would leave the plane with as little fuel as possible to minimize the spread or intensity of a fire on the ground, which can impede or prevent escape from the plane. However, fuel dumps from commercial aircraft are rare, used in situations where the necessity of dumping fuel to land safely and spare the passengers outweighs the financial costs of losing the fuel and the environmental costs of cleaning up the spill.