Are there any rules for using prefixes like un, dis, in, im to make opposite from a word?
There's a rule for "im". It comes before a /p/ or /b/ and often an /m/. That's because m, p, b are all bilabials - you pronounce them with your lips together initially. But "immovable" means "unmovable", so it's not a strict rule. un and in you have to learn.