As said (written) before, you can measure the individual pn junctions as diodes in a BJT, but it is only a part of the story.
In a BJT, the diodes share a layer, which is the base of the transistor, (So it only has 3 layers and not 4 as two separate diodes would have).
The base is also a very thin layer, and when current flows through the BE junction, a lot of the electrons "shoot through" the base because it's so thin, and they end up in the collector. The proportion of electrons that end up in the collector depends on the transistor geometry, and is a somewhat constant value called the Hfe of the transistor. Small transistors can have a Hfe of a few hundred, wile big power transisors can have an Hfe as low as 10.
Measuring both junctions of an transistor with a diode tester is a quick and convenient way to check if a transistor still works. If you can't measure the diodes, then the transistor is broken, while if you can measure the diodes, then there is a quite high probablility that the transistor works.
This explanation is a gross oversimplification, but it's a useful explanation. Such simplifications are quite common in engineering. Quite often the details of how something works is quite complicated and not very relevant for practical use. And then a simplified model is made, that is just sophisticated enough to "get the job done". And when more details are needed, the model is refined. For repairing electronics, measuring the diodes of a BJT is often enough, while this does not even explain the working of a transistor. If you want to understand the working of an electronic circuit, then the first refinement to the "two diodes model" is to add the current amplification factor (Hfe) to the model.
With a simple model you can get quickly to a result that is "good enough" for the task at hand. But you should always be aware that the model you are using is simplified, and those simplifications break at some point, and then you have to add more sophistication to your model.
A further refinement of the model would be to acknowledge that hfe is not a constant, but it varies a bit with Collector - Emitter voltage (the "Early Effect"). This effect is one of the many factors that for example cause distortion when you use BJT's to make an audio amplifier.