I would have thought so, provided the leaves are big enough not to fall out of the gaps.
My OH and I made a 1 metre square leafmould clamp using cheap trellis from B & Q. When we left the shop with it, it wouldn't fit into the car, so we had to go in and buy a cheap saw to cut it up, there and then! Gave everyone in the car park a good laugh! ;D ;D ;D
We just drove four posts into the ground and fixed on the trellis using U-shaped staples. The clamp holds a huge volume of oak leaves, which seem to be breaking down nicely - although I haven't checked lately - and it looks quite neat.
Of course, pallets are heavier than trellis, so you may need to fix them to the posts more securely than we did, our trellis...