This point has been discussed many times. You can do a search on this forum, for example about WordPress subfolder, to see the various aspects and views on this possibility, different from the easy default subdomain, and more complex especially in the frequent case that Discourse and the rest of the site are on different servers. Anyway the Discourse-WordPress integration already mentioned on this thread works equally well in all those cases.
For instance Matt Cutts, well-known former search and spam expert at Google, said some years ago that Google was pretty able to detect when a subdomain is or not part of a site, therefore sharing or not search ranking. On the other hand, some SEO experts such as Moz’s Rand Fishkin disagree with Cutts on the theory/practice correlation of this point, and say that at least currently they see Google frequently considering subdomains as different sites even in cases they are not. So it’s a controversial point.
Apart from this, as suggested by Erlend, for example using Discourse forum integration for comments on WordPress (with any kind of subdomain or subfolder installation) is indeed a great way to use content to kick start a community.