I don't think it is a good idea.
I just connected from Europe through IAD this week (US citizen).
When we reached the immigration hall there was ONE officer for all the lines- US citizens and non citizen, and there was already a long line from a previous flight as ours was entering. Fortunately we have Global Entry (prescreened fast track for US citizens) but I can't imagine the wait for non citizens. Just as we were leaving the area we saw a group of maybe 6 officers moving into the area, but it would take a long time to clear the backlog. This may have been unusual, but demonstrates a potential problem.
Yes, after passing immigration you pick up checked luggage and carry it a short way down a hall past customs and hand it back to airport personnel. After that you go through another security check, similar to first entering the airport. They rescan your carryon luggage (must abide by 3-1-1 liquids rule) and x ray or body scan. This takes more time that the luggage recheck.
Then as jameelsabio says you will need to change terminals which at IAD can mean long walks/train that can easily be 20min even if you walk fast and have an idea where you are going.
If everything works smoothly 2 hours would probably just be enough, certainly no room for any problems.