It is just a matter of convention. It should be consistent throughout.
Case 1: Work done on the system is positive.
Here the first law is written as
$$ \mathrm{d}U = \mathrm{d}Q + \mathrm{d}W \,.\tag{1}$$
If your frame of reference is "system", then the work done on the system ($W$) is positive and the heat that is added to the system is also positive, which means the change in internal energy is also positive by first law of thermodynamics, which means that there is an increase in temperature. This appeals to common sense. Here positive change in internal energy corresponds to increase in temperature
Case 2: Work done by the system is positive
Here the first law is written as
$$ \mathrm{d}U = \mathrm{d}Q - \mathrm{d}W \,. \tag{2}$$
If work is applied to the system, $\mathrm{d}W$ term becomes negative making two negatives positive, which is identical to equation (1) and heat added to the system is still positive here. Rest of the arguments follow as above.