Gen 1: There are no bag pockets, just a free-for-all space of 20 items in the bag, plus 50 more in the PC. HMs can be deposited in the PC, just like any other key items (which, for lack of a dedicated pocket, are defined here as "items that don't display a quantity").
Gen 2: The introduction of bag pockets means you can hold all TMs/HMs and key items in the game without running out of space. Still, the item PC accepts 50 items as a singular group without regard to what pocket they came from. Key items and HMs can still be deposited this way. Additionally, these games introduced held items, but you can't give a key item or HM to a Pokemon to hold (because it would be too easy to trade one away and either sequence-break the game or lock it out of being beatable at all unless you do another similar trade to get it back). Some key items have the menu option where you would give it to a Pokemon to hold replaced with one that lets you register it to the Select button; others simply remove the "Give" option with no replacement involved.
Gen 3: Key items and HMs can no longer be put into the PC item storage space. FireRed and LeafGreen take this further and only allow items from the main pocket to go into the PC, but there are only three bag pockets in those games (Items, Key Items, and Poke Balls--with Berries and TM/HMs being pseudo-pockets that are accessed via a key item instead).
Gen 4 and beyond: Due to an increase in bag storage space, the PC no longer has any need to serve as an item depository, and indeed it doesn't.