Can 2 cousins get DNA test to find out if they are half brother and sister?

There is no reason why they can't. It is simply a matter of having the two samples tested using the same methods. The results should be able to determine the level of relationship.