What to fill basement floor gaps with
Be careful. You might have a &quot;floating slab&quot; basement, where the slab exists solely inside the walls. Something like this:
  |wall|                           |wall|
  |    |(========== slab =========)|    |
  |    |~~~~~~~~~~ earth ~~~~~~~~~~|    |
 /     |                           |     \
/      |                           |      \
|footer|                           |footer|

You can tell by checking the entire perimeter. If you have gaps all around, possibly filled with some sort of squishy material (rubber, oakum, fiberglass, whatever), or possibly covered over with caulk, cement, etc., then you've got a slab that floats inside the basement walls.
In this case, you don't want to do anything that will cause the slab to damage your walls. So don't fill the gaps with cement or anything like that. You can fill the gaps with squishy materials, or you can cover the gaps.
If you fill the gaps with something squishy, you can certainly cover that with a sealant like spray-foam or caulk. (But don't fill the gaps with pure spray-foam!)
Some products you might consider: for small gaps, consider using &quot;backer rod&quot;, which is a round foam strip sold to help fill the gaps between window casings and the house framing. It comes in various diameters, so just find a side that is big enough, push it into the gap, and then you can caulk or foam over it.
For larger gaps, consider &quot;concrete expansion joint strips&quot;. These are usually inserted between one concrete pour and another to provide a &quot;pad&quot; that will absorb some concrete movement. Typically 4-8 inches tall, and  1/2-1 inch thick. If you got a long open gap that's wide enough, you might be able to jam these strips down in.