Why can the drain of a transistor be used as an output port in both OTA and TIA?
The output impedance of the transistor's drain alone is not the same thing as the output impedance looking into the drain, with the transistor biased and connected in a feedback structure.
Here's our simplified five-transistor operational transconductance amplifier:

As you can see, the output impedance of this device is very high. If you attempt to inject a test voltage onto the output node, the very small observed current will be primarily associated with channel-length modulation (i.e. \$r_{out}\$ in the small-signal model) of the two transistors on the right branch.
Let's now put this structure in feedback, to create a simple transimpedance amplifier:

Looking at the drains of the transistors on the output branch in isolation, away from the remainder of the circuit, one could argue that the output impedance is high. However, the output impedance of the circuit cannot be derived by considering those transistors in isolation. A key takeaway is that feedback may change, and often does change, the input and output impedances in a system.
Let's now apply a hypothetical test current to the output node while the input is nulled, in order to find output impedance. To simplify, I will assume that the gain of our original operational transconductance amplifier was very, very large. Because the nulled output looks like an open circuit, our simplified circuit looks like:

It is then relatively easy to show that the voltage, \$V_{out}\$ will rise very little. Note that because the resistor \$R_F\$ leads to a gate, it can have no DC current flowing through it, and \$v_{in-} = v_{out}\$ under our condition of having the original input nulled.
As long as the amplifier continues to remain within its working limits, any current injected into the output node would raise the inverting input's voltage slightly. The large gain from the 5T-OTA will increase the drain current of the bottom-right transistor (and decrease drain current of the upper-right transistor), thus maintaining a near-constant output voltage.
As you can see, we have achieved exactly what we set out to: we have shown that a simple operational transconductance amplifier has a high output impedance in its simplest configuration, but an added feedback structure brought its input and output impedance to near-zero in order to achieve the design goals of a transimpedance amplifier.