In short, yes you can. Many competitors used trainers when the Ironman was first established, and some still successfully complete using this method. But you’ll need two pairs of trainers – one pair for cycling that have a stiffer sole to spread the load more evenly and improve pedalling efficiency and power, and a pair that should bend at the ball of the foot not the arch.
Be warned though, you may lose between five and 15 minutes using trainers and flat pedals, based on the terrain and your pedal action during the 180k. To limit this, you need to focus on pedalling in a circle rather than just pushing down on the pedals.
There are some benefits to using trainers and flat pedals, though. For one, it’s much easier with trainers to get off and hike your bike up a hill compared to walking in cycling shoes.
If you decide it’s not for you, though, don’t switch to cycling shoes and cleats in the last six weeks before the race because you may not adapt and get the full benefit.