It depends on your definition of 'rebuilt'.
Engines are built to a design which includes size and clearance tolerances. As long as the engine is built within these it is considered suitable for purpose and installed in the vehicle.
However, when the engine was designed the performance was calculated based on all components and clearances being shot on, ie zero tolerance. So all production engines will be slightly down on power compared to the design figure.
If you take a new, production line, engine from a mass produced vehicle and rebuild it to the exact specificatuon you will see an increase in power (this is called blueprinting because before computers designs were printed out in white on blue paper). In race series where production engines with no modifications are permitted this is done in order to extract as much power as possible.
Having said all this, the increase in power is not as significant these days as it was in the past as engines are built to closer tolerances now.
When an engine is designed it has to meet many exacting criteria - performance, emissions, sound, fuel efficiency, longevity, variable fuel quality, varying climatic conditions and not least, cost - so they are built to a compromise. All engines have the potential to produce more power if modified but this will effect one or more of the above design criteria.
Modifying an engine to produce more power is basically very simple. The power an engine produces is restricted by the amount of fuel it can burn and this is governed by the amount of oxygen that can be crammed info the combustion chambers. Modifications that permit more fuel to be burnt will produce more power.
How to get more oxygen into an engine is dependent on many factors and can be done in various ways - improve air flow through the head, change cam shaft(s), larger valves, supercharge/turbocharge, nitrous injection, ECU remapping, etc.
And as TC above.