Since a bipolar transistor is essentially two diodes, it can function as such. However, since bipolar transistors are not designed to be used as diodes, using them as diodes might cause a problem in terms of current and other ratings. For example, transistors are generally used with a base current that is less than one-tenth the required collector current. Therefore, the elements in the vicinity of the base terminal (e.g., on-chip wires and a bonding wire) are designed for this intended use, and the current ratings are specified accordingly (see Table 1). In addition, although the base-emitter and base-collector diodes look identical, the dopant concentrations in the emitter and collector regions of a bipolar transistor are quite different (nc << ne in the case of an npn transistor), causing the characteristics of the two diodes to be substantially different.
Here is an example of using the same transistor as a diode in the temperature compensation circuit for the transistor etc. Even in such a case, be sure to use transistors within the ratings specified in the datasheet. Use dedicated diodes for typical diode applications instead of bipolar transistors.