Short answer- trainers can be behind the bench only if they are rostered as a coach and meet all the requirements of a coach. Otherwise, trainers are not allowed behind the bench during games. Practically speaking, there is ample space for a trainer to be present during a game and not be behind the bench.
USA Hockey 2021-25 Official Rules of Ice Hockey
Rule 201 Composition of Teams
(b) A team may have up to four Team Officials on the players’ bench. Only players in uniform and properly rostered Team Officials may occupy the players’ bench.
MAHA Annual Guide 2023-2024
Rules & Regulations
IX. Game Requirements
8. No more than four (4) registered team officials in good standing will be permitted in the vicinity of the players’ bench or will be allowed to coach or manage a team. Any violation of this regulation could result in the forfeiting of the game. A score of 0-1 will be recorded on the official game sheet(s) for all games if any game is forfeit.