No way. A bearded dragon would probably try to kill a sand boa immediately.
Not to mention, Bearded dragons require temps much higher than sand boas. A sand boa is going to get cooked by a 115 degree hot spot that a bearded dragon needs to properly digest food.
Mixing herps in captivity is overall a really bad idea.
However, if you are feeling creative, it would be perfectly acceptable to construct a single enclosure with different "zones" in it that are seperate from each other but still meets the needs of each individual housed therein.
For example, if you had a large tank, and wanted to do a bearded dragon and a sand boa. You could basically construct a divider, perhaps a large rock-like structure like a DIY rock background, with a piece of plexi built in the middle to seperate them from each other.