As long as the mezuzot are within the doorway, they can face in any direction.[1] However, placing the mezuzah outside of the doorway is unacceptable to many authorities. And even those who allow outside placement state that this option is far from ideal and should be avoided when possible.[2]
[1] Agur B’ohalecha 14:4.
[2] Agur B’ohalecha 14:12.