No idea about the hoof glue, but I imagine it would. So long as it A) attaches the cloth to the foam and B) stiffens the cloth dramatically. I would do a test piece and see how well it holds up.
Also, from quick reading, hoof glue doesn't like to get wet, so under mattress might have issues...