The T followed by the number represents the size of the lamp. You cannot use a T8 in a fixture designed for a T5 or the other way around. The ballast and the "Tombstones" (the plastic parts the ends of the lamp fit in) are different for each. The surest way is to open the fixture up, on the face of the ballast it will tell you what types of lamps it will fire.
And yes, T8 lamps can be single pin or two pin. The single pin style were used for HO (High Output) lamps. T8 and T12 lamps (even larger in diameter) use the same tombstones but not the same ballasts. T12 lamps are almost obsolete because they are not energy efficient. Wont be long before the same is true for T12.