All three logicians want a drink, but none of them knows whether the other two want a drink or not. So the first one, knowing that he does want a drink, knows that it is possible for all three to want a drink (as he does) but not certain; the second logician can assume that the first logician wants a drink, as otherwise he'd have said "no", and wants a drink himself, but doesn't know about the third yet; the third logician does want a drink, and can deduce that the first two also did, and so can say "yes".
* * * * *
The second one is to do with number bases. In base 10, the normal "decimal" (or Dec) system, numbers are one digit until you reach 10, which is the first two-digit number. In base eight, the "octal" (or Oct) system, you would count 1, 2, 3, 4, 5, 6, 7, "10". More here:
https://en.wikipedia.org/wiki/Octal
But in base eight, the number 31 = 3*8 + 1 = 24+1 = 25 (base 10), or "Oct 31 = Dec 25".
* * * * *
To be honest, I think they aren't so funny on the explanation. But then jokes rarely are. Anyway, I had a quiet chuckle, although I've heard both before.