The closer an open hole is to the blowing end, the shorter the remaining effective length is and the more it raises the pitch.
Generally, a hole in a given position doesn't reduce the effective length quite as much as cutting the pipe at that position would, and the smaller the hole, the less it reduces the effective length when open.
Generally, the pitch and timbre of the notes produced will depend on the positions, sizes, heights, and shapes of all the tone holes, both open and closed.
Theoretical models allow these effects to be calculated with some accuracy, but the design of tone holes remains to some degree a matter of trial and error.
The modern reproduction of the natural trumpet, called the baroque trumpet, are fitted with tone holes (called vent holes) to correct the out of tune notes (written) B♭4, F5, A5, and B♭5.