Huffman tree generation if the frequency is same for all words
Yes. When creating a Huffman tree, if you ever find you need to select from a set of objects with the same frequencies, then just select objects from the set at random - it will have no effect on the effectiveness of the algorithm.

Of course, one might question why you're bothering to build a Huffman tree if you know all the frequencies are the same - I can tell you what the optimal encoding is.