I think you can not do sandbag entrenchments for infantry units. However you can purchase things like sandbag foxhole under fortifications in the unit purchase screen. This sandbag foxhole have weapons and a crew, which bails out if the foxhole is destroyed and crew survives. Then the crew only have pistols though.
Thanks, but I originally wanted to entrench some AAA units. Well at least someone replied
(Also I didn't know about that foxhole you've mentioned. So thanks anyway)
You cannot entrench only a few selected units. In an assault/defend mission, the defender is dug-in, all of them, unless deployed in a marsh or a few other places where trenches are not allowed. The assaulter will have mortars, and infantry that deploy on foot etc in trenches.