When farming an enemy and you get a legendary from an enemy (Killed Rakkman and you get a Gunerang out of him) when you kill that specific enemy again straight after you save and quit, is it certain that you'll get the legendary again?
There is definitely not a guaranteed chance at the same legendary weapon; the pseudorandom number generator isn't nearly that easy to fool. I have farmed many many bosses for less than many many legendary weapons and I'm not sure I've ever seen the same weapon spawn successively, and it certainly doesn't happen every time.
You can still get the same legendary a second/third/nth time around, but whether you do or not is completely random based on the boss' drop rate.
Are you asking if you are guaranteed to get a legendary every time you fight a boss after getting it the first time? Because that is a resounding no. You are not guaranteed any loot based on previous loot. Even if you were able to restart fights instantaneously.
But on that same note, getting a legendary from a boss does not remove that legendary from the loot table. You can get the same legendary from a boss as many as times as you can fight the boss. I don't know if the odds change at all* but there is always a chance for a legendary to drop despite how many times you have killed a boss. So yes it is possible to get a legendary several fights in a row. The odds are not in your favor but statistically it is possible.
*: The Warrior is unique if I recall correctly, where the first kill has something like a 90% chance of dropping a legendary. After that, it goes back down to a 'normal' boss loot table with legendaries being dropped only rarely.
AFAIK no, it's not certain. If I'm not mistaken, the algorithm processes the drop the moment you kill it, there is no predetermined fixed value regarding drops.
Say that you kill a Psycho and it drops a green weapon, exiting, reloading and killing the same Psycho again won't result in the same drop.