You won't damage the engine by running it at full throttle, but you will waste a lot of gasoline.
Sailboats are displacement hulls with a theoretical maximum speed of about 1.22 times the square root of the waterline length. (No need to debate the various interpretations of hull speed here.) What that means is once the boat gets to hull speed applying more power does very little to increase speed. All that happens is more fuel is burned pushing water.
A 25 ft boat has a hull speed around 5 to 5.5 knots (about 5.5 to 6 mph) Once the boat reaches that speed adding more throttle does not increase speed, so you will seldom if ever run the outboard at full throttle.
Powerboats that can plane will use extra HP and throttle to go faster, because they plane and are not bound by hull speed.
A larger outboard on a sailboat provides more power to punch through chop and to go up wind, it won't increase boat speed. Make sure the outboard bracket can support the extra weight and torque from the larger motor.