According to spin Seebeck effect, a thermal spin current will be produced when a temperature gradient is applied to the metallic ferromagnet. Similar to the electrical spin transfer torque (ESTT) induced by spin-polarized current, there is also a thermal spin transfer torque (TSTT) caused by the thermal spin current, which can be attributed to the s-d interaction between the conduction electrons and the local magnetization. In this paper, the generalized analytical expressions of thermal spin current and TSTT are derived based on the spinor Boltzmann equation (SBE) under the local equilibrium approximation. This generalized TSTT has different terms compared to the previous phenomenological form, and the phenomenological coefficients can be determined theoretically within our framework. Combined with the SBE under the applied electric field and temperature gradient, we solve the Landau-Lifshitz-Gilbert-Levy equation to study the domain wall (DW) motion driven by the ESTT and TSTT. We investigated the temperature-dependent DW motion, the total spin torque, and TSTT in permalloys. We found that the velocity of the DW can be promoted by increasing temperature and temperature gradient, which provide a path to effectively utilize the Joule heating in spintronics devices.