I doubt that the poet is the geologist. For one thing, the geologist was only 23 in January, 1840, so it's not likely that he had at that time been writing poetry "for many years" (although "many years" may mean something different to a 23-year-old than it does to me). Also, he was working in Ireland at the time, which conflicts with the fact that the preface was written in "Allesley, near Coventry". Neither of these proves that they are different Thomas Oldhams, but they are suggestive.
On the other hand, the British Museum lists the author of this book of poems as "OLDHAM (Thomas) of Allesley",* and there is a survey reference in the archives of Coventry (http://discovery.nationalarchives.gov.uk/details/r/972963d4-2179-4912-8c86-c8927f827abb) that refers to one "Thomas Oldham, of Packington, Warwickshire, miller", who in 1817 owned property bordering Allesley. This (or perhaps one of his relatives) seems a more likely candidate for the poet. But of course there's no way to know for sure.
---------------------------
* BM Catalog:
https://books.google.com/books?id=I2BGAQAAMAAJ&pg=PA1863&lpg=PA1863&dq=%22oldham+thomas+of+allesley%22&source=bl&ots=ebKHMqyIV1&sig=MaVJnAzSVJa2YhOK1W96H-MuX50&hl=en&sa=X&ved=2ahUKEwjcurqn7PndAhWrct8KHUjeBCIQ6AEwAHoECAEQAQ#v=onepage&q=%22oldham%20thomas%20of%20allesley%22&f=false