Legally, you can license your code under any license you feel like, even one which doesn't make sense: for example, you could license a piece of music under the Open Database License. In some cases, that might mean that you aren't in fact granting anyone any rights, but that's still something you're allowed to do.
Is it a good idea to use licenses for purposes they're not intended? In almost all cases, almost certainly not. License proliferation - where users must understand more and more licenses in order to use a combined work - is a real problem. If you want to license code under a short, permissive license instead use one of the MIT or BSD licenses; these are better understood by the community and will probably lead to greater uptake of your code.