I think this is a good question.
Let me propose some guidelines:
1) A religious invocation should occur at the beginning of the talk or the end of the talk, but not in the middle of the talk.
People often begin talks with material that is unrelated to the topic of the talk itself, e.g. thanks to various organizers; comments about the weather, the venue or the town; jokes; and so forth. It seems to be clearly asking too much for someone to speak only about their scientific field during the entirety of their talk. However, at a certain point you get down to business and the "talk itself" in the narrower sense begins. One should not (of course this is an opinion, but a strongly held and easily defensible one) mix religion with the material of the talk itself.
2) A scientific talk is not an occasion for proselytization.
To me whether religious material is appropriate depends a lot on the purpose one has in bringing it up. If you include religious material as an attempt to convert audience members to your religion, I think that is really problematic and unethical. If you include religious material for other promotional reasons, then I still have a problem with it, just as I would be with someone promoting their not wholly scientific company or product. (Even wholly scientific promotion might not be so great, but that's a different answer.)
On the other hand, it is a totally standard thing to have the last slide of a talk give thanks to various people and institutions. If you feel deeply grateful or thankful in the religious sense, then it seems natural to want to express those feelings, given that other speakers are thanking people and things (e.g. the US government) that, in your sincere opinion, have not helped you out as deeply or fundamentally. At any rate, it does not bother me if someone ends a talk by thanking some theological entity.
3) One should not express religious sentiments in a scientific talk in a way that encroaches on anyone else's religious sentiments or lack thereof, nor which implicitly or explicitly invites or requires participation or complicity from the audience.
Thus "Alhamdulillah" is probably okay; "Now Thank We All Our God" is probably not.
In general, in (e.g.!) an academic context, one should be respectful of others' beliefs and views, and one should not be controversial or exclusionary in anything without a specific intellectual purpose for doing so. One should also be respectful of others' time and realize that speaking in front of a group is a privilege. On the other hand, academics are human beings and can choose to say things which are not strictly necessary. In my calculus class last week, I had students identify a quote about mathematics being someone's worst subject followed by a careful and insightful consideration of the reasons for this. The quote turned out to be from Malcolm X. What calculus reason could I possibly have to quote Malcolm X? None. But I thought it was interesting and perhaps important in its own way. I enjoy my freedom to do that, so it is not a hard sell for me to give leeway to those who want to make some kinds of religious statements, so long as they are in line with the above guidelines.