Several people working in the White House who are not among the Trump family members or their allies have expressed concern to the president about putting Mr. Ayers in that role, and have warned that some staff members might quit because of it.

Mr. Trump hates interpersonal confrontation, and he often lets aides he does not like remain in their positions for uncomfortably long times, meaning changes could still be weeks away, the people close to the president cautioned. And Mr. Ayers’s name has been mentioned as a Kelly successor before, only to disappear as Mr. Kelly has remained in his post.

But Ms. Nielsen has been a target of Mr. Trump’s ire for many months, primarily over his administration’s “zero tolerance” immigration policy and his belief that she was not implementing it effectively.

Mr. Trump and Mr. Kelly arrived at a plan earlier this year for Mr. Kelly to remain in his job through the 2020 election, but the president has privately told allies that he would not bet on his chief of staff staying that long.

The Washington Post first reported that Ms. Nielsen may depart soon. A White House spokesman did not respond to an email seeking comment.

Mr. Kelly has often defended Ms. Nielsen to the president, and protected her from other cabinet members when she was under attack from them.

Among some of Mr. Trump’s allies, his views and treatment of Ms. Nielsen have been characterized as unfair. The president has derided her previous service in the George W. Bush administration and questioned her loyalty. He also helped ensure that she was the face of the deeply controversial border separation policy involving taking children from their parents.