The Nile always take the definite article in English, so it’s “the Nile”, which sounds a lot like “denial” (the voiced TH and D are very similar). A river in Egypt is unrelated to the conversation, so by saying that “denial is not a river in Egypt”, the speaker is saying that “denial” is not unrelated to the conversation — in other words, the speaker is suggesting that the other person is in denial (i.e., denying a fact that should be obvious). I don’t know the origin — isn’t that explained in the Wikipedia article? Anyhow, it’s just a silly play on words that makes no sense, sort of like the famous Chespirito phrase, “no hay de queso, nomás de papa”.