Can someone who works in tech industry still publish research unrelated to their main job function? It seems to be a common trend nowadays that high paying jobs in the tech industry tend to have both a combination of employees from STEM related fields and non-STEM related fields. Also, I know that companies like Google allow employees to spend 20% of their time to do tasks of their own interest. Given these two facts can an employee, say someone with a Ph.D in astrophysics who works at Google, still publish in journals such as Physical Review, Journal of Physics, etc? This would alleviate a lot of problems, since the difficulties to transition from industry to academia is quite troublesome. Thoughts?
The path to publication at a company strongly depends on whether the employment contract includes a "we own your dreams and family photographs" clause.  Some technology companies insert such a clause, essentially claiming rights over anything that their employees do that could possibly create intellectual property.

If you are faced with an employment contract of this sort, there is generally a possibility of specifically exempting certain activities as a sort of "pre-existing condition."  If you exempt your research area or if you have a more liberal employment contract, then you can generally do whatever scientific research and publication you like outside of work, as long as you do not claim endorsement of the company in any way (e.g., you may not be able to list them as your official affiliation in the publications: check with your supervisor or company legal).

Alternatively, tech companies with broader interests may be entirely fine with you working on projects unrelated to your responsibilities while acting as a company employee, as long as it does not interfere with your ordinary job duties.  This is often particularly true for companies that have a consulting or contracting business model, since for such companies "unrelated research" can often turn into "new line of business."  Likewise for companies whose product line serves the R&amp;D community.  Companies that have a tight focus on a non-R&amp;D-related product line, however, are less likely to be receptive to such "side-project" work.