I'd suggest you check the wiki because the list is huge, but here are some general rules:
-Anything that deals magic damage can't damage through magic immunity (physical, composite, universal and HP removal can damage you)
-Stuns/bashes etc that are listed as physical (not in terms of damage) cannot be blocked by magic immunity
-Some magical stun exceptions which pierce through BKB exist like primal roar, fiend's grip, reaper's scythe etc
-Anything that is listed as "dispellable" can be dispelled by becoming magic immune
-Some friendly abilities like heals or buffs can't be casted on you while magic immune
-Most ultimate abilities go through BKB, but there are several which don't, like dream coil, chakram etc.
Here's the link to study in more depth: http://dota2.gamepedia.com/Magic_immunity