I've done the DXB transfer quite a few times. You can stay airside, but BA will not issue the return boarding pass in LHR.
You have to go to the DXB transfer desks operated by Emirates. Two problems here - they'll think you're mad as they want to know why you're going straight back. And they'll almost certainly put the wrong frequent flyer number on the boarding pass. This can be fixed at the gate if you get the BA supervisor.