Vijay Kumar, Sterling Dictionary of Idioms (1998) reports that "as near as dammit" and "as near as makes no difference" are variant expressions of the same idea:
as near as dammit; as near as makes no difference an amount, a measurement, etc. that is not significantly less or more [Examples:] It is going to cost Rs. 8,000 or as near as dammit. The cloth is five times longer or as near as makes no difference.
Two other very similar expressions are "as near as makes no odds" and "as near as makes no matter," both of which appear in Norman Schur, British English from A to Zed: A Definitive Guide to the Queen's English, second edition (2013)—which JOSH quotes in his answer. Here is that reference work's treatment of the relevant expressions:
as near as dammit Inf[ormal]. just about Slang. Almost exactly; give or take a bit; very close! We'll get there at seven, as near as dammit. Or, Can we make it in two hours? As near as dammit. The origin of the phrase is as near as 'damn it' is to swearing.
as near as makes no odds Inf[ormal]. just about Inf[ormal]. Sometimes as near as makes no matter. Either is equivalent to give or take a bit. For example: I'll get there at nine, as near as makes no odds, i.e., so near that it makes no difference.
G.F. Northall, "Folk-phrases of Four Counties (Glouc., Staff., Warw. Worc.)" (1894) lists "As near as damn it" without any specific county attribution, meaning that it was then current in all four.
The "as near as makes no difference/odds/matter" wordings are perhaps clearer on their face than "as near as dammit/damn it", but all appear to be of roughly similar age, to judge from Google Books search results. As JOSH notes in his answer the earliest Google Books match for "as near ... as dammit" is from 1871.
But the earliest Google Books matches for the other versions are very nearly as old. From a letter (dated June 18, 1877) by H. Hunt to the editor of The Fishing Gazette (June 22, 1877):
I went upstairs to the club room some 10 or 15 minutes afterwards, and found the roll called most clandestinately by Mr. Foster, as I was there quite time enough (within half-an-hour) of the usual time for the roll being called, and so was Mr. Ghurney, who I saw arrive at as near 11 o'clock as makes no difference.
From J.P.W., "Trout Fishing at Mill-Head" (July 19, 1878):
Then, with my rod at arm's length, and high up in the air, I just managed to reach him [the trout] with the net, and carried him up for friend Brownjohn's approval. "Well, he's a beauty, baint he," was his remark, as he came out of the dairy and looked the splendid fellow well over lying on the moss-covered flag stones. "What's his weight?" said I. “Four and a half, as near as makes no matter," rejoined the farmer. We put him in the butter scales, and he just drew 4lb.—Bell's Life.
And (somewhat later) from Platelayer, Great Northern Railway, "A Night in the Fog," in Railway Herald Magazine (January 1895):
After we had finished talking (between trains) over this incident Ted asks me how long I had been a fogman. I tell him “near six years, as makes no odds,” not a very long time as compared with some others I daresay.
An Elephind search turns up instances of this last phrase from as early as 1886. From a letter to the editor of the [Perth, Western Australia] Daily News (May 1, 1886):
For the sake of comparison I will here state that Belfast and Warrnambool are as nearly as makes no odds the same distance from Melbourne as is Fremantle fr*m Geraldton, passages between which ports Mr. James Lilly, the local manager here for the Adelaide Steamship Company, books at the following rates all the year round, excursion rates being a peculiar term altogether unknown in W.A.: ....
I can't tell whether the "as makes no difference/odds/matter" family represent a euphemistic toning-down of the "as dammit/damn it" duo, or whether the latter represent cacophemisms of the former. But all seem to have appeared in historically close proximity to one another, in Britain or its possessions, and with extremely similar meanings.