If the gas in my domestic boiler was burnt in a cylinder to drive a piston and subsequently an alternator, as per a car engine, would I lose any heating effect because of the work done by the piston?
Yes and no.
In an entirely closed system, energy is always conserved, so eventually, all the energy of the system will be converted back to heat via other paths, eg frictional heating of the moving parts, electrical heating, sound etc. and the total heating will be the same.
However, presumably your definition of useful heat energy is that which will heat the water in your boiler, and this will certainly be reduced if you allow energy to escape the boiler system via mechanical and electric pathways.