Aren't all H's in chinese transcribed as k in japanese?
Unfortunately, the assumption is wrong. From the way of asking I guess you are familiar with any Southern dialect of Chinese or old school romanization (like Wade-Giles), but either way, Middle Chinese is known to have two: voiceless H (曉母; estimated to be [[h]] or [[x]]) that is closer to K, and voiced H (匣母; [[ɦ]] or [[ɣ]]) that is closer to G, which are conflated in most of modern dialects. Japanese borrowed Chinese words during that period, which is why some kanji retain the distinction in on'yomi.
A small number of Chinese dialects, such as Wu including Shanghainese, also still retains the voiced/voiceless contrast, so you would find the initial of 亥 different from 海. Another thumb rule is, where a dialect has 陰陽 distinction of tones, characters with H and 陰 tone is 曉母 and 陽 tone is 匣母.
That said, it is true that the number of kanji with G corresponding to Chinese H is smaller than they should be, because the 漢音 tier transcribes 匣母 with K, reflecting the devoicing feature of the accent of 長安, the capital, at that time (search by the term Sino-Xenic for further discussions). Nevertheless, since the older 呉音 readings, prevalent in more basic words, are more faithful to standard Middle Chinese system, you would have a lot of chance to see this sort of pronunciation including: 行【ぎょう】, 玄【げん】, 含【がん】, 号【ごう】, 画【が】, 下【げ】 etc.