Prep is what it's all about. Sanding or sand blasating to get a good surface for the paint to grip Spray a light tack coat - for the next coats to "grip" on the first few coats, progressively going with heavier coats closer to the surface being painted, allowing a half hour to an hour between the last coats.
One more tip, warm up the paint by either running hot tap water over the can and/or sitting the can in a pan of hot tap water. Obviously do NOT put the can in a pan on the stove! The warm paint mixes better when shaken, atomizes better spraying out of the can and flows better on the surface. The can should be warm to your touch if it is warm enough. When it feels normal or cool rewarm the can You will even see the paint sprays better. Cool paint may spatter, warm paint doesn't.
By the way, on the muffler the heat isn't near what it is on the head pipes. It's still seriously hot and probably any paint used should be heat resistant.
A tip on painting regular parts, there is a company or two making two part urethane clear, SprayMax 2K. It's about $20 a can and once activated it is good for nearly 24 hours before going bad in the can. The advantage is the paint is more impervious to gasoline. If it can withstand the heat on a muffler it would be a good thing to do, but I don't know.
I will say on the one member's comments about the RD. I had the same problem with all my two stroke bikes with chambers. It was always the head pipe though. the cones and stinger/silencers ran cool enough the paint worked fairly well. The heat on the head pipe just burned off the paint nearly instantly it seemed. Four strokes tend to do the same on the head pipes. I personally prefer the ceramic coatings after having my KLX pipe done by JetHot. The heat pipe has held up for 12 years now without any special treatment. The stuff just plain works. It ain't cheap, but it holds up like nothing else and colors can be had.