In the current version of Dwarf Fortress (0.47.4), you can build temples to deities in your fortress in Fortress Mode, and dwarves will go there to pray to their various gods and deities and receive the positive "enraptured" thought. You can designate a temple for a specific god, or just a general temple not dedicated to any specific god, so that presumably all dwarves can pray there regardless of their deity.
However, I'm curious if dwarves who are part of one religion are able to worship in the temple of a different deity. I've never observed this happening in my own fortresses - i.e. when I dedicate a temple to a god of death (for very valid reasons), only the death worshippers will go there to pray as far as I can tell. So usually I just make one general temple that suits everyone, but sometimes I wonder if I need to make a bunch of temples, each dedicated to one specific god, to make everybody happy.
The wiki doesn't really clear this up, and the Temple page only states:
If you read the thoughts of certain dwarves, you can note that some have been "unable to pray to (x deity)". If you designate a temple to that specific deity, they will then go pray or meditate with purple text and satisfy their religious needs. This mechanic needs more research. In some cases a dwarf who worships multiple deities may not ever pray to them all. Using burrows to force these dwarves to pray only in generic temples will usually make them eventually (sequentially) satisfy all their needs to pray, given no other tasks.
Similarly, there is this forum thread that discusses how temples work, but it doesn't answer the question fully either.
So, can dwarves who worship one deity successfully pray at another deity's temple? Or do they absolutely, positively need to have their own god's temple or a generic temple available?