If none of the Pokemon you have at any one point cannot learn a certain HM for progression, then you may catch one but it must be immediately boxed as soon as it is not needed. If this Pokemon is one of your first six, then it is permanently added to your team
I.E You have a full team of six and need to know Flash to get through Rock Tunnel, you may catch a Meowth and box it when you get out of Rock Tunnel.
You don't have a full team of six and need to know Flash to get through Rock Tunnel, you may catch a Meowth but since you don't have six yet, it becomes a permanent member of your team.
In addition, if you have a Pokemon that can learn an HM, you cannot catch another Pokemon just so that one Pokemon doesn't have to use that HM. If you have any other means of getting through that part of the story without catching another Pokemon, you MUST take that option.
In 2x Addition, you cannot use HM slaves for optional places, like the Seafoam Islands.