Standard advice I give to graduating Ph.D. students: If you're absolutely sure that you don't want an academic position (i.e., become a faculty), then it's fine to go to industry. If you are not sure, pursue a postdoc (which could be in industry), because a permanent position in industry is a one-way street out of academia. A faculty member can always get an industry position, but once you're in industry for a while, it's very difficult to get an academic position.
I've heard countless times a student say something along the lines of: Oh, I'll just work a few years in industry, see how I like it, and then come back to pursue an academic position. This is highly unlikely.
It comes down to publications: To qualify for a good academic position, you can't stop publishing. Let's say you work in industry for two years and want to apply for an academic position: Your competition consists of postdocs who have spent the last two years with a singular focus on pumping out publications to get the best possible academic position. Who do you think is going to "win"?
But then I hear the student say: Oh, this position I've been offered, it's a research scientist position. The company encourages publications.
Oh really, I respond: Who on your future team has published in the last year? This is a standard recruiting pitch: We're really changing the culture around here, to open up and encourage publications. I'm sure they've used the pitch on plenty of other job candidates before, and certainly for those who already joined the team. I ask again: What's the median per researcher publication output over the last few years?
The truth is, for most organizations that recruit and hire Ph.D. graduates, the best case scenario is that they will not prohibit you from publishing. That is, sure you can work on papers, but that's on your own free time (i.e., nights and weekends). The key question to ask is: at your performance review with your boss, are publications going to be a metric that factors into your promotion or salary increase? In other words, are there any parts of the incentive structure tied to publications?
As a generality, going to industry is a one way street. There are, of course, certain exceptions: Microsoft Research and certain parts of Google are the two notable ones. For example, Microsoft Research specifically hires postdocs: fixed-term appointments with a focus on publications that provide natural stepping stones to faculty positions. I am highly skeptical of companies that are "opening up" or want to "change their publication culture". Culture is very difficult to change.
I've had many conversations with students that are basically variations of the above sequence. Typically, they end with something like: I'm different, I'll be an exception. And I say, good luck, really meaning it. To be an exception requires, I think, incredible inner drive to continue publishing, because the external motivators (e.g., publishing in order to graduate) are no longer there. How to maintain this "fire" and "hunger" in the presence of pressure to ship products, organizational politics, as well as competing demands outside of work (e.g., family) is challenging. This is why I say working in industry is a one-way street out of academia.