If there is positive relationship between independent variable and dependent variable and negative relationship between moderator and dependent variable, can we apply moderation analysis?
everything depends on the theory you're building your hypotheses on. You need a strong theory in your hypotheses development section, so you have to already know what your theory suggests about your hypothesized model and influences.
If you're referring to correlation analysis - IV positively correlated with DV and M negatively correlated with DV - sure, that's fine: I suppose you're testing a negative moderation analysis. This means that your M variable is supposed to lower the relationship between IV and DV.
Yet, is the theory you're relying on consistent with this? Are there already published empirical results similar to your analysis? Compare them with yours.
By the way, I suggest you to have a look at Hayes' bootstrapping statistical procedure, which is now one of the most acknowledged techniques to test moderation/mediation: http://processmacro.org/index.html
the correlations are completely irrelevant. A moderation means that the relationship between the IV and the DV constantly and systematically change if the moderator variable changes. As Lamberto already said, you have to build a theoretically based hypothesis for such a scenario.
In addition to Lamberto's suggestion to use PROCESS, you could suggest doing a latent moderator analysis. The reason is that moderator analyses are low-powered and a latent model can circumvent the problems. And be sure to have a sufficient N. Non-significant effects simply due to low power can be avoided.