The condition for threats triggereing:
"When a companion or ally is killed and that card is placed in the dead pile, the Free Peoples player counts the number of threats on the dead pile and then removes them..."
This implies that being killed and being placed in the dead pile are separate steps (ie a companion could be killed but not placed in the dead pile) I would argue that a companion would have to have been killed before being placed in the dead pile. Therefore, its possible to have to use Sam's ability before Frodo is placed in the dead pile.