The response can, and historically has, come from any nation, not just the one the ship is registered in.
For instance in the last (Somali) attack before this, a Maltese flagged tanker was boarded, and a Spanish warship arrived the next day and retook the ship.