The issue depends on the circumstances of the person. If a muslim man for example can control his sexual desire, then he can press ahead with Hajj. If it is the other way round, then he may go ahead with marriage and then perform Hajj when he becomes able to do so.
Imam Ibn Qudamah stated in his book Al-Mughni regarding the issue: If a person cannot control his desires and fears lest he may indulge in immorality, he may get married before performing Hajj because marriage in this case is mandatory, and an indispensable means of protecting oneself from committing sins. In this case, marriage resembles one’s daily provision.

However, if one is able to resist his desire and he is not fearful of committing sins, he should perform Hajj because marriage here becomes a supererogatory act, and as such cannot take precedence over Hajj, which is obligatory.