Yes, you can upgrade directly from 3.x to 4.x. However, please read the documentation before doing so.
I have copied a few links to our documentation on how to upgrade, what to expect, and what to consider before upgrading.
http://www.splunk.com/base/Documentation/4.0.11/Installation/Whattoexpectwhenupgradingto4.0
http://www.splunk.com/base/Documentation/4.0.11/Installation/UpgradeonUNIX
http://www.splunk.com/base/Documentation/4.0.11/Installation/UpgradeonWindows
http://www.splunk.com/base/Documentation/4.0.11/Installation/Stepsformanualmigration
... View more