The expression comes from military usage.
Wictionary
An allusion to the military practice of capturing/holding a hill (high ground), no matter the cost or (lack of) benefit, as in the Battle of Hamburger Hill or Last Stand Hill.
To take the example of The battle of Hamburger Hill: it focussed on the capture of the hill. It had little point beyond capturing the hill.
History
Hamburger Hill marked a turning point in America’s involvement in the Vietnam War. After nearly a dozen deadly assaults, on May 20 the U.S. military finally captured Hill 937, known locally as Dong Ap Bia (“the mountain of the crouching beast”). When they abandoned it just days later, controversy erupted over what many saw as a senseless loss of lives—a debate that has continued in the decades since.
Hence the idiom refers to stating, occupying and defending a position or argument beyond what is necessary or in any way beneficial in comparison with the losses incurred.
Considering your examples:
I think that science fiction is the best book genre and that's a hill I will die on.
means:
It is your opinion that science fiction is the best, and you are prepared to defend that opinion strongly and without changing it even if it means you look foolish in the face of other opinion.
X is a great movie. I will be dying on this hill.
means:
X is the best and you will accept no other opinion whatever arguments are made against you.
I want to convince him not to die on that hill.
means:
You believe he has an indefensible position or attitude and you want to persuade him not to make a fool of himself by sticking it to it at all costs; he will only lose and look foolish, or suffer detriment.