A MQ broker offers a variety of services, each of which uses a different port.
See "Configuring Connection Services" in the MQ Admin Guide:
The port that a service uses is allocated dynamically. Normally clients don't need to know these ports; they connect to the port mapper (7676 by default) which will then redirect the client to connect to the appropriate port for the protocol being used.
If you want to connect across a firewall you will need to configure these services to use a static port, and open these ports on the firewall.
See "Connecting Through a Firewall" in the MQ Admin Guide: