A t12 ballast is a reference that essentially refers to the size of the tube of the florescent bulb that is being used. T12 tubes pull 40 watts, and are frequently being replaced with lower wattage t8 tubes, which operate on 32 watts. When posing the question can a t8 light work on a t12 ballast, the short answer is no. Because the ballast is specific to the wattage of the bulb, and not necessarily the size, it doesn't matter that the tube is the same length, what matters is that a t12 ballast will push more power than a t8 light is designed to handle. The only way around the dilemma is to replace the ballast.
Cost of Replacement
Ballasts are not necessarily expensive; you can find a t8 ballast for under 20 dollars. Even if you have many that need replacement, this still does not amount to a huge expense. When you consider that the t8 is more efficient than the t12, the cost is easily justified.
Resources for Replacement
Ballasts can be purchased in your local hardware store. If you are in the market for something more industrial, there are a number of resources available online to purchase the right ballasts that you need.