At Dulles, you pickup your bags after customs. If they want to search your bags, they will regardless.
Immigration (can you enter) --> international baggage claim --> customs (can your stuff enter) --> transfer bag drop.
edit: Same setup for Boston, it seems?
https://www.jal.co.jp/jp/en/inter/airport/bos/info/
Immigration: "Customs declaration form - not required"
Then baggage claim, then...
Customs: "Please show your passport and customs declaration form. (Your customs declaration form will be collected here.) If you have any items to declare, please declare them to an official."
Not that you can reach that point without stating your declarations on the record. I think it was one of the kiosk stages.