We verify the finite-time fluctuation theorem for a linear Ising chain in contact with heat reservoirs at its ends. Analytic results are derived for a chain consisting of two spins. The system can be mapped onto a model for particle transport, namely, the symmetric exclusion process in contact with thermal and particle reservoirs. We modify the symmetric exclusion process to represent a thermal engine and reproduce universal features of the efficiency at maximum power.