Early brass instruments, such as natural trumpets and horns, did not have valves at all. Players could only produce a limited number of notes by changing the length of the instrument using their hands or with crooks (additional sections of tubing).
Valves were first introduced in the early 19th century and initially, some brass instruments had only two valves. These two-valve instruments, like the keyed bugle, allowed for more flexibility in playing scales and melodies. However, they still had certain limitations in terms of range and chromatic accuracy.
It was later in the 19th century that the three-valve system became more widespread. The addition of a third valve greatly enhanced the chromatic capabilities of brass instruments and allowed players to access a wider range of notes. The three-valve system became the standard for many brass instruments, including trumpets, cornets, trombones, and tubas.
So, it is not accurate to say that all brass instruments historically had three valves. The three-valve system evolved over time and became the standard in the 19th century, but it was preceded by instruments with two valves and even instruments without valves altogether.