Boston police Commissioner Michael Cox said the off-duty officer was in the fast food restaurant around 5:30 p.m. when two people ran inside, chased by a man with a knife who was trying to stab them.