H.264 has an auxillary channel, set in place in codec and format specification as useable in providing transparency. I have not seen an encoder capable of using it.
(PDF download only)
https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.264-201106-S!!PDF-E&type=items
you can read about it here. It's a bit dense, but the International Telecommunication Union's spec for H.264 encoding explicitly states transparency(and additional luma maps) as being a use for the specification's auxiliary channel. However it also notes "The... decoding of auxiliary coded pictures is not required" and I don't think it was ever used in an official capacity.
The confusion is likely because mp4 and quicktime can both use the h.264 codec, but quicktime, (both the container and player) supports transparency, so theoretically mp4 can be encoded with it as well, though it would require a dedicated decoder. I have seen a hack that simply encodes an alpha layer to another video or at the end of the file. Adobe video export can default to uncompressed RGBA in the case that quicktime alpha output is requested, meaning you can ask for h.264 quicktime, request alpha, and get a quicktime with transparency that is not h.264. This confused me in testing and took a couple tries to figure out what had actually happened to my file. Combined with confusion over quicktime player and wrapper(they support both H.264 and alpha but not simultaneously), all of this could be a source of public confusion.
This is incredibly late, I understand, but these videos, I believe, primarily come from After Effects' and Adobe's encoders and decoders, which are Apple-blessed, and therefore take advantage of Apple quicktime player's RGB+A decoding update which was not related to its h.264 characteristics. Adobe removed them when Apple deprecated both quicktime and the de4dicated player, but the wrapper was added back after years of public protest because there was no functionality to replace the workflow. It is indeed a saga.
Apple has deprecated quicktime, and it's been deprecated for years, but is still in active use in VFX because to my knowledge neither Apple nor Adobe supplied a replacement for video that was both heavily compressed and supported alpha. Webm is looking like a modern replacement, but its support by third parties is spotty, and AV1, touted as an h.264 replacement does not seem to officially support it at all.
(edited for correctness- mostly the bold stuff. sorry people who noted I had it a little backwards! quicktime being deprecated and prores and uncompressed RGBA using the same extension as quicktime really obfuscates things... premiere had the codec ommitted because it was uncompressed, which turned me around as I hadn't requested it.)