It is possible, but not easy. If you are going to keep corals, you are going to have to deal with light, which will mean a DIY project. If you are successful with corals, they will sting or crowd out one another in a very short period. A tank that small really won't work well for any fish. A small shrimp or two, and a few hermits and snails. So, you will be doing all the work for a saltwater tank, and not be able to keep much in it.
Based on the polls and threads I've been reading at nano-reef.com for the past year or so, most nanos in the 3-5 gallon range don't make it past their first 6 months. There are some experts who can make it work indefinitely, but that tiny volume means that a crash can happen very fast.
If you are serious about it, I would recommend having a look at the articles and threads at nano-reef.com. It may be for you. It may not.