Firewall is a network device which is used to manage and protect traffic between networks with different levels of reliability and security.
Sandbox is a security mechanism for separating running programs.