They are completely different:
----------------------------------------------------------------------------
1. A telegram was something roughly equivalent to sending a text message back in the days before long distance telephone service became wide spread.
As it was originally developed in the 1840's, it worked something like this: You took your message to your local telegraph office. The guy there tapped your message on a "key" that caused a receiver in telegraph office in the city you were sending it to make some clicking sounds. The guy at the receiving end translated the message back into words, wrote them out on a form. The messages (telegrams) were then hand delivered by young men.
In the 1840's this was hot state of the art technology. It was also very expensive, so private messages tended to be urgent matters like, "Uncle Fred died, funeral on 23". They charged by the letter, so messages tended to be extremely short.
As technology improved, the system was automated. After the introduction of direct long distance telephone calls (~1960's) telegrams quickly died out.
------------------------------------------------------------------------------------
2. Fax machines are a pre-computer technology for sending copies of documents using telephone lines. You can still buy fax machines, but they have become a lot less common in the last 15 years, having been replaced by Internet technologies.
Using a fax machine is simple, you put the document in a paper feeder and dial the phone number of the fax machine you want to send it to. A copy of the document prints out on the receiving fax machine. The print out is called a "Fax". Or "fax" can be used as a verb, as in, "I will fax you the order."