You can trademark your open source project, but only the biggest projects do.
You used to be able to buy yourname .com, .net, .org and that was a de facto trademark. Now there are gTLDs you can't.