Yes you can, as long as you increase the voltage at the same time. Think of HP as a shorthand notation of "A certain amount of torque at a certain speed". If you increase either value, you increase HP. The trick is to increase one without a corresponding decrease in the other. That's what happens when you MECHANICALLY change speeds, i.e. a gearbox or belt and pulley system. Speed goes up but torque goes down, or vice versa, but HP remains the same (other than added losses in the process). But with a VFD, torque is a product of voltage AND frequency, you can think of it as a V/Hz ratio. If you increase or decrease them together at the same ratio, you can change HP without changing torque. Lower is of course easy, that's what we are essentially seeing with the traditional application of a VFD. At 50% speed we are at 50% voltage, torque remains constant because the V/Hz ratio is unchanged, therefore HP is 50%. But at 100% speed and 100% voltage, you are maxed out. Since you can't make the VFD put out more than 100% voltage, any further increase in frequency begins a DECREASE in torque; we call this "operating in Constant HP mode" because with no additional voltage, you can no longer maintain the V/Hz ratio and torque begins to drop off.
I would like to ask for some more enlightenment on this portion. Please bear with me for a few moments.
You said: "HP as a shorthand notation of "A certain amount of torque at a certain speed"." . I have no problem with that. But when you said it is possible to operate the pump at a higher frequency and not increase the voltage, something seems not right. The OP specifically mentioned the VFD is capable of providing 400V @ 97Hz. Clearly, this VFD maxes out at that voltage and frequency, hence the need for us here to respond whether there will be no problems with him agreeing to the proposed setup - 230V motor-pump to be driven by a 400V-100Hz VFD, that is.
I must agree that your scenario is possible when a 230V VFD was in use and that the VFD capacity was maximum at 230 volts. Further incursion into higher frequency region becomes a constant power mode.
Still, my opinion is that in order for that setup to work, the owner should make sure the motor is rated for inverter duty and that necessary limits be punch-in into the VFD configuration that will protect the motor (VFD settings set to conform with motor capacity). If indeed, the owner want to take advantage of higher output or higher delivery head, I recommend the HP rating of the drive motor be checked and should be bigger than the capacity of the submersible pump else the motor gets toast! I also would like to point out that most motor suppliers to submersible pump makers learned how to over-rate their motors knowing that the motor duty will be that of being submerged under water. That could add to the problem here since we would expect that the motor actual rating will be smaller compared to the pump rating.