Sure they can "affirm" but that's not the same thing. The courts don't ask people "Do you affirm to tell the truth, the whole truth, and nothing but the truth so help you God?"
It may differ from state to state, but as far back as I can recollect, in my state the court asks, "Do you
swear or
affirm to tell the truth, the whole truth, and nothing but the truth so help you God?"
If you respond "I do," the court doesn't ask you whether you
swear or
affirm. I've
been a plaintiff, a defendant and have served on a jury, and this is what I've experienced.