See Flight Manual
Answer here is simply to consult your flight manual. The 172 models I am familiar with allow sideslipping with any flap setting however sideslipping with more than 20 degrees is to be avoided (but not prohibited) if possible due to a slight tendency for the tailplane to oscillate.