cold-cocked by a cocked hat
Robert Chapman & Barbara Kipfer, Dictionary of American Slang, third edition (1995) suggest entirely separate etymologies for the two terms. Here is the entry for "knock ... into a cocked hat":
knock something into a cocked hat v phr by 1833 To demolish, esp. to disprove, invalidate, or show the falsity of a statement, plea, etc: This knocks our whole case into a cocked hat {literally "flatten," since a naval officer's cocked hat could be flattened}
And here is the entry for coldcock:
coldcock by 1918 1 v To knock someone unconscious; = KNOCK someone OUT [examples omitted] 2 n The act of knocking someone unconscious quickly before the victim can resist {origin uncertain, perhaps fr the hammering of caulking into a boat's or ship's seams; perhaps related to Canadian loggers' put the caulks to someone, "stamp in someone's face with spiked boots"}
Cold-caulk does sometimes appear as an alternative spelling to cold-cock with the same meaning, going back at least to 1936; and "cold caulking" as a form of caulking is discussed in numerous publications from the 1910s, so the chronology is plausible—but I haven't seen any other source make this claim.
The Microsoft Encarta College Dictionary (2001) finds a different origin for cold-cock more probable:
coldcock vt to knock somebody unconscious, especially with a blunt instrument (slang) {Early 20C. Probably from the idea of knocking somebody cold with a blunt instrument such as a COCK "faucet."}
On this point, we do see an advertisement for Chapman Plumbing & Supply Co. in the [Canton, Ohio] Stark County Democrat (March 31, 1910), for a washstand with "Guaranteed Porcelain Enamel. China Index hot and cold Cocks, Nickel Bibbs, Trap and trimmings," but how widespread cock was for faucet or tap in 1910 is not immediately clear.
A writer in the American Dialect Society Publication, issue 21 (1954) [combined snippets], meanwhile, takes a Freudian approach to analyzing the genesis of the term:
The word colcock, rather widely used in South Carolina, meaning to knock out, to knock unconscious, is not dialectal, but gangster slang. It is probably derived from the name of a type of blackjack consisting of a leathern pouch, five or six inches long, filled with shot and used by gangsters to blackjack their victims. Its resemblance to membrum virile flaccidum would give rise to the name. In the American Thesaurus of Slang, cold-cock is defined either as a knock-out blow, or, as a verb, to knock out. But in spite of the fact that cold cock has not as yet been found in the sense of a blackjack, I am persuaded that this is the origin of the slang word. This theory was suggested to me by one of our correspondents.
The term cold-cock may well have arisen as slang in the late stages of World War I, to judge from this excerpt from "Statement of Capt. Charles M. Stephens, 12th FA." in Hearings Before Subcommittee No. 3 (Foreign Expenditures) of the Select Committee on Expenditures in the War Department (1920), describing events that occurred on September 23, 1918, and afterward:
On the night of September 23, 1918, I was arrested and confined at Hotel St. Anne, Paris, France, upon the complaint of the Swiss proprietor of the Hotel Montana, who, because I had questioned and protested a large overcharge in my hotel bill, used this form of blackmail to force me to pay whatever he liked.
...
By this time Capt. Adams, A. P. M., came in. He intimated that if I didn't get upstairs and be quick about it, that I would be "cold cocked" or words to that effect, and carried up.
Conclusions
The term cold-cocked seems to have arisen in the vicinity of 1918. Theories of its origin range from caulking the seams of a boat, to striking someone with a blunt object such as a water faucet ("cock"), or to striking someone with a blackjack that resembles in shape and size a flaccid human penis. None of the reference works I consulted, however, made any connection between cold-cocked and "knocked into a cocked hat."
It may be noteworthy that, by the time cold-cock arrived in U.S. slang, "knock into a cocked hat" may (as Chapman & Kipfer assert) have become more commonly associated with knocking something into the hat than with knocking someone there. In contrast, cold-cocking is normally associated with knocking out a person.
I think we may be talking the wrong caulk. When you caulk a wooden ship, hot pine tar and oakum would be forced into the seam using caulking irons and a mallet. If you had to do this "cold" one would expect you would need to hit much much harder with the mallet to drive the Caulking into the seam. Cold Caulking would = hitting vary hard