The effect of arbitrary orientation in the magnetic field on the entanglement and dense coding of a two-qubit XX model is investigated. The concurrence and optimal dense coding capacity are calculated for different orientations of the magnetic field. It is found that the entanglement can be maximized by rotating the magnetic field to an optimal direction at given temperature. Furthermore, there exists critical concurrence Cc, beyond which the thermal state is unfeasible for optimal dense coding.