How DNS service discovery, multicast DNS and Bonjour are related?

I just answered your previous question over here.

I think that answer covered the questions you asked here, but just in case:

Bonjour consists of 3 parts:
1. IPv4 (and IPv6) link-local addressing (169.254.0.0/16 addresses in IPv4).
2. Multicast name resolution (via the mDNS protocol). This allows hosts on an ad-hoc or isolated LAN to automatically map host names to IP addresses for each other by multicasting out DNS queries and responses amongst themselves, without needing a traditional unicast DNS server.
3. DNS Service Discovery, which allows you to discover the names and details of services of a given type. On a local network, DNS service discovery is typically done via mDNS as well, but via "Wide Area Bonjour" you can actually do DNS Service Discovery for an entire domain via a unicast DNS server.

The dns-sd tool lets you do all the queries/lookups necessary for parts 2 and 3, which I gave examples of in my answer to your other question.

I think part of your confusion is coming from the fact that there are command-line tools with the same names as the protocols. mDNS is the name of the multicast Domain Name Service protocol, but it's also the old name of a common command-line tool for sending mDNS protocol queries and receiving responses. "dns-sd" is the current name of the most common command-line tool for doing DNS service discovery, as well as for doing multicast name resolution lookups. Both of those command-line tools generally call APIs that are handled by the "mDNSResponder" background process / service / daemon.