Can I get braces if I have a cravity?

Bad idea. The order of rx should be: 1. Control infection (cavities, gum disease, etc) 2. Move teeth/jaws into best possible relationships 3. Do final gum treatment and restorations have your cavities fixed before you straighten your teeth. It's highly unlikely that a qualified orthodontic specialist would risk moving diseased teeth.
Not recommended. It is best to get your teeth checked by a dentist and any cavities filled before you start orthodontics.