You'll need to ditch the wall-wart...
Even if your powered anode's "wall wart" power supply is rated for 240V operation (likely, albeit not guaranteed), you still cannot interface it directly to the water heater circuit, as it is only designed to plug into a 15A receptacle (likely a NEMA 1-15, but even if it had NEMA 2-15 blades on it, this would still be an issue), and 15A receptacles aren't legal to have on 30A circuits, because you could overload the receptacle without tripping the breaker if you did such a thing.
...but with the correct power supply, this can be done
However, the receptacle size issues aren't a problem for a hardwired power supply, and while there are a variety of options for this available due to UL 508 listed 24VDC supplies being common fare in industrial controls work, it turns out that McMaster-Carr carries a UL listed, 100-250VAC input, 24VDC output supply pre-mounted to a 4" square junction box cover for under $20. With this, a 4" square junction box, some bare 10AWG wire and a 10-32 grounding screw to serve as a grounding pigtail, a few suitably sized wire nuts and cable clamps, a whip of 10/2 NM (or a suitable wiring method for your jurisdiction if NM isn't permitted) to go from the new box into the water heater, and a suitable cable to connect the screw-terminals the power supply provides for its output connections to your powered anode, we can solve your power delivery problems without pulling another circuit.
Installation of the linked supply goes as follows, presuming you've already done the plumbing work to install the anode itself as per its instructions:
- Turn off the water heater's breaker (of course)
- Install the 4" square box somewhere near the water heater that's reachable by the existing cable run and pry out a pair of suitable KOs for your clamps.
- Unwire the existing cable from the water heater and run it into the junction box, securing it with a clamp.
- Wire the whip from the new box down to the water heater, securing it to the box with a new clamp and reusing the existing clamp at the water heater end (if the water heater wasn't wired using NM, simply retain the existing clamp on the end of the existing cable in the prior step and use a new clamp to attach the whip to the water heater here)
- At the box, attach the 10AWG grounding pigtail to the box's grounding screw hole with a 10-32 screw.
- Nut all bare/green ground wires together
- Nut both black wires from the cables to one of the wires from the power supply
- Nut both white wires from the cables to the other wire from the power supply
- Mount the power supply/faceplate to the junction box
- Connect the power cable from the power supply to the powered anode
- Turn the breaker back on, and enjoy your hot water!