The US Navy cannot legally board foreign ships but a US Coast Guard officer can.
A US Naval Officer or NCO boarding a foreign flag vessel in international waters is considered an act of war. A CG Officer has authority to do so under existing conventions. Not all countries abide though. If a private vessel is suspected of holding contraband then only A CG Officer may board without permission and collect evidence.