My experience has been that it's always accepted, but often Duolingo suggests exactly the same sentence but with the special letters as an alternative correct solution. Obviously it shouldn't do that.
If you are actually having translations rejected because you write gx for ĝ, ux for ŭ etc., then you should check the following: - Is it really true that everything else in your answer is exactly correct? - Did you use one style consistently? E.g., using ŭ and gx in the same sentence might be problematic. (I don't know, I have never done this.)
If the answer to both questions is yes, you should tell as on which platform you are having this problem, as there can be important differences between them. Duolingo exists in a web version and i separate versions for iOS, for Android and for Windows Phone. There is also a Windows 10 app now. As I haven't tried it out yet, I am not sure if it's the same as the Windows Phone version.