Yes and No. They are the same as far as ends, watts and length. But the T-8 is smaller in dia. than the T-12.
So a T-8 can replace a T-12 in a pinch, but a T-12 will not fit in place of a T-8. The fixture for a T-8 is smaller clearances as a T-8 is around a inch in dia. T-12 are over a inch in dia.
Make sure the tube is what the ballast is rated for.