Most trees will grow anywhere they can get enough nutrients. That includes growing in boulders and blocks of granite as you can see in these photos I took on in person (or in tree.)
As long as the roots can reach moisture and soil, they’ll grow. Tree roots are stronger than any rocks they may encounter.
If you're worried, improve the soil with amendments that meet the need of your particular tree. And be aware of the proper planting depth. If you're planting a new tree, whatever the soil level is on the trunk in the container, is where you want it when you plant in the ground.