Yes, you can, and a really great example of that is the ‘Three Sisters’ grouping that has been a  popular method discovered by Native Americans. With the  sisters --- Corn, Squash, and Pole beans – you have a grouping that is supportive of each other and which enriches the soil for all. The corn, for instance, provides vine support for the beans, which in turn are going to enrich the soil with nitrogen that all  sisters can take advantage of. As those beans grow up through squash vines, they will also knit the  sisters together more tightly for mutual support. The squash will also chip in with its prickly leaves, which help to keep away pests, but will also create a sort of living mulch that will help the soil to retain more moisture by keeping it cool and will also keep weeds at bay by taking up the space. It’s a classic example of companion planting at its finest and well worth trying sometime if you’ve got the patience and the space.