You can use a caulk and backer rods to fill the gaps between the foundation and a sidewalk. They are pretty much used in the same way to fill the gaps between the foundation and the home. And in some cases, if the gap is relatively small, you can use the caulk by itself.