As @Dirty-flow said, sleeping in the car is allowed, but you should not sleep in the driver's seat etc. if you are drunk, to omitavoid being fined for drunk driving.
There are many areas, especially inside of the "Mittlerer Ring", where parking is restricted (residents only or parking ticket, see map or text).
I'd suggest to park somewhere in the outskirts, near a U-Bahn or S-Bahn station, and use public transport. Feldkirchen, for example, has a nice lake you can swim in ("Erholungsgebiet Heimstettener See").
Update: Sleeping in a caravan in the city of Munich is forbidden: "Im Wohnmobil am Straßenrand zu übernachten ist im ganzen Stadtgebiet nicht erlaubt." See Tor-Einar Jarnbjo's answer for more information. (They suggest parking at the Messe in Riem, 35 Eur per night.) Feldkirchen should be OK.
Also note: You need a particle emissions sticker for your car ("Umweltplakette") if you want to drive inside of "Mittlerer Ring".