It depends on the creed of your particular religion. If your particular religion has no prohibition on smoking, then it depends on any requirements related to praying. And if that is not stipulated, then it depends on your own concept of what prayer should be and how it should be conducted. I am the member of an especially open religious community, so I believe this is up to me. I happen to be a person who prefers to focus to the degree possible on one activity at a time, especially something I take seriously, so I would rather smoke my pipes and pray as separate activities, unless there is some compelling reason and need to pray that arrives while I am smoking, in which case, I'd go ahead and pray. It's been interesting to sort this out. Ordinarily, I am not so studious in my religious thought.