The plural of "heir" is "heir". There are many other words like this. Is there any rule how we can understand when a word cannot have a different plural form? Or do I have to mug up those words? Please help me.
There is no rule determining whether or not a noun's plural form is the same as its singular form. As the comments point out, many of these words are words for animals. Another trend I have noticed is that loanwords from Japanese often don't change in the plural (two kanji, three Pokemon, ten anime), though sometimes they do (six ninjas, eighty futons).
The plural of heir is heirs.
The plural of hair is hairs.
Also, your question is about which words have a plural form which is the same as the singular form. You aren't actually asking for which ones have "similar" forms. Arguably, "heir" and "heirs" are similar forms, wouldn't you say?
A quick rule of thumb for determining which words might have identical singular and plural forms is to think about how their referents manifest themselves in real life: are they easy to pick out individually, or are they always indistinguishable as part of a group?
These days, deers are easy to pick out. But perhaps when they were more plentiful, deer, like wildebeest and zebra, blended in well with their herd.
This, by the way, is also the logic behind the concept of an "uncountable" noun. It's quite hard to pick out an individual water. On the other hand, when we compare Japanese water to Austrian water, here we are indeed speaking of different waters.