It could be safe, but you can't be sure. The problem is, many products claim to be "suitable for use on all carpet types" or "suitable for use on wool carpets", but unfortunately, sometimes they are not. Even leading manufacturers of cleaning chemicals can overlook the specific requirements of wool carpets.
It is therefore very important to look for the WoolSafe Mark on the carpet cleaning product you are about to purchase or use on your wool carpet. Only products legitimately displaying the sheep mark have been independently tested and are really safe for wool carpets and rugs.
Note: even approved products need to be tested on an inconspicuous area of the carpet before use.