All this is very confusing. I'm not even sure who it is we are actually looking for, but assuming that we are looking for the parentage of Thomas Stuart or Hunter of the 78th Regiment, who married Sarah Roslyn in 1844 and Emma Ireland in 1881, then we have
1. His father was Thomas Hunter. Thomas Hunter is described in 1844 as an Attorney and in 1881 as a Solicitor. As already explained, an attorney is not a specific profession in Scotland, so you need to look for a man described as a solicitor or (given the date) more likely as a writer.
2. In the 1851 census Thomas gives his age as 32 and birthplace as Scotland. In 1861 he says 42 and born Scotland. This implies that he was born in 1818 or 1819.
3. In 1891 he says he is 74 and born in New Abbey, Dumfries. That gives a birth date of 1816 or 1817. In the original document it looks as if the enumerator has first written just 'Abbey' and has later added 'New' and 'Dumfries'. As has already been pointed out, New Abbey is in Kirkcudbrightshire, not in Dumfries-shire.
4. He changed his surname from Hunter to Stuart/Stewart about 1851.
5. There is a Thomas Hunter, Private, 78th Regiment, born Scotland, in the barracks in Blackburn in the 1841 census. This implies a birth between 1816 and 1821, so he could be the same man.
6. There is a service record of Thomas Hunter, No 2849, in the 78th Regiment, who were stationed in Aden until 1 April 1851. The 1851 census was taken on 30 March 1851 and shows 'your' Thomas Hunter living at 21 Fleet Street with wife and children. So it seems unlikely that No 2849 is Sarah's husband. If he isn't, then Sarah's husband must have been discharged from the Army between 1844 and 1851. (And which one is the one in the barracks in 1841?)
It is possible that the Edinburgh solicitor who died in 1848 was the father of 'your' Thomas, and that he named his son in his will, so it might be worth having a look at the will. The inventory is a list of his assets, so probably not worth looking at this unless the will provides useful information.
Thomas jr's Army service record, if it can be found, should also be useful.
FWIW I also think that Thomas Jr was probably illegitimate, but as there is nothing in the New Abbey Kirk Session records, looking for information in other Kirk Sessions would be like looking for a needle in a haystack. A large needle and a small haystack, perhaps, but still not an easy task.
You could try one of the web sites that specialises in indexing old records and finding paternity suits
https://www.scottishindexes.com/paternitysearch.aspxhttps://www.oldscottish.com/sheriff-court-paternity-decrees.html