Same site answering to two domain names

On the surface this is quite trivial, WP discerns domain from current configuration and it can be defined in config file:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

This can easily be done dynamically, depending on current domain being requested from PHP context. As long as domains map to same IP and location on server.

Note that duplicate content is considered universally bad idea for SEO. From that point of view it would be preferable to pick one domain name as canonical and 301 redirect another one to it (which is usually outside/unrelated to WP).