This definitely can't be done with DNS.
I think the real question you want to solve is "How do I allow cross-domain PHP and fonts?"
To enable cross-domain PHP and font files (this is probably all you need) you would add the 'Access-Control-Allow-Origin' header to domain2's configuration, like so
Apache:
Header add Access-Control-Allow-Origin "http://domain1.com"
Nginx:
add_header Access-Control-Allow-Origin "http://domain1.com";
If you do it this way you don't need http:/domain1/domain2 at all, get rid of it as it's confusing.
If you actually want to permanently redirect domain1/subfolder > domain2 then it's a simple change in domain1's configuration like this.
Apache:
Redirect 301 /subfolder http://domain2.com
Nginx:
location /subfolder {
return 301 http://domain2.com;
}
Note that for both sets of answers, the Nginx directives need to be inside your server {...} blocks, and the Apache rules can go in your virtualhost config or in .htaccess (do yourself a favor and skip .htaccess if you can, put everything in your config/virtualhost for performance reasons). The Apache rules rely on mod_rewrite and mod_headers, which must be enabled.