The pair, who are both 37, were hurt during the incident near the driving test centre in Brooms Road at about 1.10 am.
They both ended up at Dumfries and Galloway Royal Infirmary, and one of them has since been transferred to Glasgow for further treatment to an injury.
Police are investigating and have appealed for witnesses.
Detective Inspector Dean Little said: “At this stage we are not looking for anyone else in relation to this incident. We are, however, seeking the help of anyone who may have witnessed what actually happened with these two men.
“We are also reviewing CCTV footage in the area, however would be keen to hear from anyone who can help us in this investigation.”
Officers are particularly keen to speak to a ‘Good Samaritan’ driver who took one of the men to hospital in his car and they have appealed for him to come forward.
DI Little added: “We would also like to reassure the public that this does not appear to be a random attack on these two men and as such there is no danger to the local community.”
Anyone who can help should call officers at Dumfries on the 101 number, quoting the reference 0156/18. Information can also be passed anonymously to Crimestoppers 0800 555 111.