PIC16F877 pin functions order in pin name
There is no "order of functions" for pins. Pins that are configurable usually have a "default" configuration, and then you can use the control registers to select an alternate function. 

So in your example, the pin is named RA2, it probably defaults to GPIO and has alternate functions as analog input 2 or VREF. There is no "order" there, which one it is depends on which configuration you select.

Usually in naming they are given as:

[Name]/[Alternate 1]/[Alternate 2]/.../[Alternate N]

The order that they appear on a symbol is completely up to the person creating that symbol but is usually the same as the data sheet, although some will just put the name (ie RA2) and some may have them in different order. They are the same pin if they have the same name though (you shouldn't have 2 pins with RA2 in them, but you may have 2 pins with AN2).