If there is no slippage between the bicycle tire and the trainer's roller and if the bike computer is correctly calibrated for tire size, then the speed shown on the computer will be the correct speed. Note however that the power required to go that speed on the trainer may not be the same as the power required to go that speed on the road.
On the trainer I can do 26 and 27 for about an hour, so it says but I put it on the highest resistance it can go. How much more energy or more power would it take to go that fast outside? Or if I was on the second hardest resistance
As alienator says, provided there no major slippage, the bike computer should faithfully record how fast the wheel is turning.
However, unless your trainer is a high end computer controlled ergometer, what wheel speed you can attain on a trainer bears little resemblance to what you can do outdoors, simply because the resistance forces involved are quite different.
Or to put it another way, for the same effort going up or downhill, into or with the wind, would you expect your speed to be the same?
There is likely to be a combination of resistance forces you'd face outdoors that might result in an equivalent wheel speed that you attain on your trainer (e.g. a particular gradient and/or level of air resistance) but since such factors vary so much outdoors, it's not a practical to think in terms of indoor-outdoor speed equivalency.
Just use indoor wheel speed as an additional indicator of effort level (along with others you might use, such as perceived exertion, or heart rate). Of course if you have power measurement you can ignore indoor speed altogether.