The loco link is decided based on several factors -
1) Load charts - Based on the gradients, curves and track restrictions on a route, the officials prepare load charts that decide the locomotive power required for various loads (rake length, rake weight) on that route.
2) The schedule of the train combined with the load chart, decides the minimum requirements of the loco link for a train. Any locomotive that meets these minimum requirements can be allotted to the train.
3)...
more... The other important factor is the locomotive utilization and availability. Bascially, keeping a loco idle, is a waste of money for IR. So, a locomotive must always be used to the maximum possible extent. This won't be possible if they add restrictions like the train should only be run by its own zone's loco.
So locos are allotted based on availability at the trip shed and in such a way as to ensure maximum utilization of the locomotive fleet.
In recent years, due to the addition of HOG, WAP7's have become the preferred choice for many trains. In these cases, the loco class is being picked based on secondary features like HOG. In terms of schedule and load, other locomotives will also be able to do the ob like a WAP7.