The origin of "knickers in a knot" and "knickers in a twist"
Where do the idioms "knickers in a knot" and "knickers in a twist" originate from? I cannot seem to get to the bottom of the origin!
The Cambridge International Dictionary of Idioms (published in 1998) says that "get your knickers in a knot" is "Australian, informal," and that "get your knickers in a twist" is "British & Australian, informal"—but it doesn't say when either expression came into use.
Dictionary treatments of the phrases
Nigel Rees, A Word in Your Shell-like (2004) has this brief entry for "knickers in a twist":
don't get your knickers in a twist! 'Don't make a drama out of a crisis, don't get worked up or confused or you'll make the problem worse.' As 'knickers' (for female underwear) is solely a Britishism, this phrase has not travelled. In use by 1971.
Eric Partridge, A Dictionary of Slang and Unconventional English, eighth edition (1984), however, assigns the expression a much earlier origin:
knickers in a twist. Don't get your ..., don't become cantankerous or contentiously touchy: both among men (implying femininity) and from men to women: since ca. 1950. (L[aurie] A[tkinson] 1976)—2. Get (one's) knickers in a twist, to get flustered, to panic: coll[oquial]: since 1960 at latest. {A petty officer speaking:} 'Just pay attention to what I say and then we'll have nobody adrift or roundabout mid-forenoon getting his knickers in a twist' (Heart).—3. To be under a misapprehension, or muddled, about something, as ' 'fraid he's got his knickers in a twist on that one': since late 1960s: coll[oquial]. Cf. get (one's) wires crossed, or have a leg over. This nuance perhaps influenced by the earlier, synon[ymous] get (one's) knitting twisted.
Judith Siefring, The Oxford Dictionary of Idioms, second edition (2004) has this:
get your knickers in a twist become upset or angry. British informal This expression was originally used specifically of women, the humorous masculine equivalent being get your Y-fronts in a twist. [Example from 1998 omitted.]
However, Charles Doyle, Wolfgang Mieder, and Fred Shapiro, The [Yale] Dictionary of Modern Proverbs (2012) gives pride of place (or at least fame of first occurrence) to "knickers in a knot":
Don't get your panties (knickers, undies, drawers, etc.) in a twist (bunch, wad, knot, etc.).
1965 Wilbur Smith, Train from Katanga (New York: Viking) 145: "'Well, bugger off, then,' snarled Bruce. 'Okay, okay, don't get your knickers in a knot, bucko.' He sauntered off down the corridor." [Subsequent citations omitted.] Often the sentence is merely a rebuke to someone displaying agitation or anger, but sometimes it is used proverbially—as general counsel against incurring or succumbing to needless irritation.
It bears noting that Wilbur Smith is not originally from the UK or Australia (the two countries suggested in the OP's question as sources of the allied expressions "knickers in a twist" and "knickers in a knot"), but from Zambia (or Northern Rhodesia, as it was then known).
Sightings in the wild
The earlist two Google Books matches are for "knickers in a knot"—first in Wilbur Smith, The Train from Katanga (1965) as cited in the Yale Dictionary of Modern Quotations above, and then from Frank Norman, Barney Snip—Artist (1968):
"Oh do stop it," she gasped as their lips broke away from each other with a resounding plonk. "You're getting my knickers in a knot!"
"You're marvellous," sighed Barney loosening his grip on her slightly. Without hesitation she seized the opportunity of escape, and leapt to her feet.
But the next seven matches are for "knickers in a twist"—one match for the phrase from 1969, three from 1970, and three from 1971. Here they are.
From Pigeon Racing News and Gazette, volume 25 (1969):
Wasn't trying to steal your glory. mates, just got me knickers in a twist after the New Year celebrations when I wrote the column! Also got my wires crossed when I gave all the glory to Frank and Graham Wright for CA in Kent & Sussex Fed in '68. This should have read CA W. Sect., as Hayward & S. took the honours for E. Sect. with a higher Vel. which would of course have collared the CA for the whole Fed if there had been just a single honour.
From Zeno, Grab (1970) [text not shown in snippet window]:
'All right, Tim, tell Eleanor not to get her knickers in a twist. I'll manage.' Tim cackled a bit, and went back to the cabin. I started to enjoy being at the helm.
From John Summers, Dylan (1970):
'Alright, alright—don't get your knickers in a twist.' Reeves adjusted the middle button on his sports jacket. 'This bloody beer's putting weight on me ...'
From The Listener, volume 83 (1970):
No, what has always concerned us, and people like us, has been the very clear impression that there is in the BBC a kind of emotional blockage: a built-in attitudinal leftism which does not feel the lest bit guilty about investment in new machinery but which gets its corporate knickers in a twist at the very idea of spending similar sums of money on innovatory management techniques, on outside professional advisers, on promoting itself to its market, or even on matching the programme budgets and salary scales of those dreadful pirates on the other channels.
From Fred Basnett, Country Matters (1971):
'I don't sodding well have to do anything.'
'OK, don't get your knickers in a twist. All I'm saying is it's laid on when you want it.'
From London Charivari, volume 260 (1971):
A well-meaning bunch of Coventry schoolteachers have got their knickers in a twist because when a child wrote "There is seaweed in the sea ..." his Asian teacher corrected it to "There are seaweed in the sea."
And from Films and Filming, volume 18 (1971):
Ironic that Miss West, who got so many knickers in a twist in the 'thirties, should be tied up in the affair. Do you, like me, recall her famous one word line, in I'm no Angel—'Suckers'?
Conclusions
The British expression "kickers in a twist" goes back in print at least to 1969 and refers to women's (or girl's) underwear becoming twisted and therefore uncomfortable and objectionable. Partridge's suggestion that it was influenced by the earlier "get one's knitting twisted" is intriguing but difficult to demonstrate. Also interesting is Siefring's claim that the early masculine counterpart to the phrase was "get your Y-fronts in a twist. "Knickers in a knot" appears even earlier—in 1965—but seems to have lacked the staying power of the more familiar wording.
Meanwhile, in the United States, a very similar expression emerged at close to the same time: "get (one's) panties in a bunch." Thus, from Sam Shepard, Mad Dog Blues & Other Plays (1972):
WACO One a them tigres. I knew it. We're gonna die. We're all gonna die.
MAE WEST Don't get yer panties in a bunch. It's just the call a the wild.
The timing and the substantive similarity between the British and U.S. expressions are so close that it seems unlikely that the two idioms arose independently of one another. The British expression is much more common in the early 1970s, so it seems likelier to have been the original phrase, transliterated by Americans when they returned home after being exposed to it in the UK.