Upvote:3
It's fine, in the sense that nobody will be offended or find it particularly odd, but will it mark you as an obvious tourist. That said, assuming your profile photo is accurate, you will stand out as non-Indian anyway.
A baseball cap would not be appropriate in more formal settings like offices, weddings, fancy restaurants etc, but that's the same in the US too.
In general, baseball caps are a very American thing, wearing one anywhere outside the US is likely to immediately get you tagged as American.