Questions like "why does X mean Y" are questions of etymology (also called "origin") and can be answered by consulting one or more dictionaries and studying the relevant analyses. For your first question:
I've got a flipping headache
If you consult Oxford Dictionary - flipping it says:
British
informal
[attributive]
Used for emphasis or to express mild annoyance.
‘are you out of your flipping mind?’
You said in your question that this is an English TV drama. Dictionaries typically denote a primarily British or American usage as "British" or "UK" or "Briticism" for usages primarily used in Britain and "US" or "American" or "Americanism" for usages primarily used in the United States. Printed dictionaries also typically describe their formal notation for this in the first few pages.
So, why do English people say flipping? The etymology ("Origin") line of the same entry says:
Early 20th century: from flip + -ing.
The verb flip has several meanings, but the most likely entry of relevance is this:
[informal] [no object] Suddenly lose control or become very angry.
So, flipping is a word used to express annoyance or anger, which is consistent in how it is used in your examples. You also correctly noted that this is an English phrase, not commonly used in the U.S. This fact is also mentioned in dictionaries.
I know "freak" is a very strong word, but can't understand why "flipping" can be too. Is it because the term "flipping someone off" (a term I just learned while searching for answer myself)?
Freak is probably not related, but according to the above page on flip, the etymology is:
Mid 16th century (as a verb in the sense ‘make a flick with the finger and thumb’): probably a contraction of fillip.
So it's possible your analysis is correct. The American-focused dictionary Merriam-Webster has a separate entry for "flip off", separate from "flip":
Merriam-Webster - flip off
: to hold up the middle finger as an obscene gesture of contempt to
M-W mentions 1982 as the first recorded usage of "flip off" in the above sense. Oxford English Dictionary Online does not mention "flip off" explicitly in this sense as far as I could tell, so it is possibly an Americanism.
On Euphemisms, "F-bomb" and "the F word"
The word fuck has become a sort of universal swear word that can be used in a variety of purposes. But it is also very strong, and is even not allowed on some broadcasting networks, so sometimes people substitute a different word for this word. For this reason, one might think that "freaking", "fricking", "frigging", "fracking", "frelling", or other words beginning with F are euphemisms for "fucking." However, it is not always so clear. For example, fricking is noted by Merriam-Webster as an alteration of frigging, and frig is a verb dating from 1610 which means to copulate.
The words frell and frelling were invented for the American science fiction television series Farscape and were most likely used both as humorous euphemisms for "fuck" and "fucking", respectively, as well as a clever way to avoid saying "the F word" on the air, which is typically not allowed on American broadcast television. Fans of the show may occasionally use these words for humorous effect, but they haven't reached widespread use.
Widespread euphemisms for 'fuck' include the the phrase "F-bomb", often used with "drop" ('He dropped an F-bomb during the interview.' = He said 'fuck' or 'fucking' during the interview.) the phrase "F word", which is a catch all euphemism for a word beginning with F, almost always 'fuck', 'fucking', 'fucker', etc., and simply "F", "F-ing" or "eff" or "effing".
However, since 'fuck' can be used in so many situations, I would hesitate to too quickly conclude that a particular word beginning with F is always a euphemism for "fuck" or "fucking". Supposing that a particular word or phrase has a particular origin without researching its origin is known as folk etymology.
frack/frak
was invented in the original BSG back in 1978.