Lets get one thing straight: by law, fansubs, in any form, are illegal. The argument that they are OK because the title is unlicensed in the region is completely fallicious for most countries because of the Berne Convention, which upholds internal copyrights for literary and artistic works. So, in this light, one may wonder where the fansub code originated. Simply put, the fansub codes are arbitrarily created rules to restrict the fansubbing of licensed material. The fansubbing community has traditionally had a single intent: to create easier access to anime for--primarily--American fans. If you look back into the history of anime in America, you will realize that anime was never available in large quantities until the '90's. Fansubs actually began sometime in the '70's with the release of the Amiga. As you can imagine, in the '70's, it was extremely hard to procure anime, let alone translated anime. As a service to the fanboys and girls, fansubs were created and freely distributed in the community. But as a precautionary measure, to ensure that domestic anime licensors would have sufficient business, fansubbers created the fansub codes. They have been long-standing and thus, have become something of prevailant thought in the anime community. Traditionally, domestic anime licensors have turned a blind eye to the fansubbing community because they were in limited distribution and because they know that fansubs actually promote domestic anime sales. However, with the advent of digital fansubbing in recent years, the fansubbing codes are starting to lose weight because of the wide-spread distribution and because of the many who completely disregard domestic releases and, instead, download all their anime. It is not unusual to hear about domestic companies taking measures against fansubbing these days, however, their efforts have had very little impact.
On the subject of HK subs, I am under the impression that they are very much illegal, regardless of the region and whether they are downloaded or not, as they have been reabsorbed by China. Originally, Hong Kong did not sign the Berne Convention, which means that bootleg literary and artistic works were legal, but only within the confines of the country. As a bit of information for you, the other countries that did not sign the Berne Convention include Singapore, Taiwan, and South Africa.