Not recommended — #29 of 31 Denim ranks #29 of 31 fabrics for chafe resistance. It is a poor fabric for this. Ranked with a smooth-fibre bonus plus low weight and breathability. The top pick is Silk.
Denim measures 45/100 for breathability, 8% moisture regain, 60/100 warmth, at 340 gsm. Chafe resistance rewards a smooth, light surface: Denim has more surface texture at 340 gsm.