Hi D D,
yes, up on installation of each Gateway you need to specify a management server it reports to. This automatically bcomes the Primary Management Server of an Gateway.
You can assign a Seconday Management Server or even a List of Secondary Management servers, all this, using PowerShell.
This is covered in great details with examples here:
and the same examples are listed in official MS Learn documentation for SCOM:
I hope I could help you out!
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)