It's indeed possible [I spent many years in industry building math software, and now I'm a tenured prof, albeit in computer science and software engineering department rather than math; although my research involves building mechanized mathematics systems...]. I started my academic career having previously 'published' 0 academic papers! I was, however, already well-known within the computer algebra community, and my work was known [so I was able to get many good academic reference letters]. The reason for me to report this is that it is important to be able to convince the academic community that you really have something to contribute, else why would they hire you? So, if you intend to move back to academia, either write papers or make sure that somehow the community 'knows' you and appreciates your work.
From my experience, I would say that the hardest part is to go from having well-defined goals with precise deadlines, often driven by external pressures, to writing research papers with no deadline. Getting up to speed on producing papers while being on the 'tenure clock' was most unpleasant. And, of course, at the beginning teaching courses can (and likely will) swallow all available time. Unless you're in an enlightened department (I wasn't) where untenured faculty are given a lighter teaching load to allow them the time to get settled into their research career.
If at all possible, get a post-doc in between a non-academic job and a tenure-track position. This will give you the time needed to 'switch gears'. I probably would not have done that myself (the salary cut was already substantial enough as it is, I didn't want to make it even worse). It depends on your personal situation.