When starting with foam, I tried several varieties of nail polish, clear and colored. The answer to your question is NO.
Foam, even good closed cell, will compress. The best nail polish is not...