Mesoscopic thermoelectric heat engine is much anticipated as a device that allows us to utilize with high efficiency wasted heat inaccessible by conventional heat engines. However, the derivation of the heat current in this engine seems to be either not general or described too briefly, even inappropriate in some cases. In this paper, we give a clear-cut derivation of the heat current of the engine with suitable assumptions beyond the linear-response regime. It resolves the confusion in the definition of the heat current in the linear-response regime. After verifying that we can construct the same formalism as that of the cyclic engine, we find the following two interesting results within the Landauer-Büttiker formalism: the efficiency of the mesoscopic thermoelectric engine reaches the Carnot efficiency if and only if the transmission probability is finite at a specific energy and zero otherwise; the unitarity of the transmission probability guarantees the second law of thermodynamics, invalidating Benenti et al.'s argument in the linear-response regime that one could obtain a finite power with the Carnot efficiency under a broken time-reversal symmetry. These results demonstrate how quantum mechanics constrains thermodynamics.