You're correct on Military Production - no overflow/refunding does happen. For optimal play this means to match your planetary output with shipdesigns having different costs - let's say a planet outputs 75 MP/turn but your ship costs 120 MP, then you are at liberty to increase its costs up to 150 MP. Although it may increase the likelihood of increase maintcosts, but you sometimes can have stronger ships. Usually additional hitpoints are far too expensive but in these cases they are a fine option.
Social Overflow is somewhat a mystery. Your excess production can flow into a building, and it is taken into account with decreases OVERBUILD-COST. This is the reason why sometimes the same buildings have different costs when you overbuild them with the same improvement.
AFAIK carryover from research doesn't happen in vanilla DL but in the other xpacs it does.