Can a cousin write a recommendation letter for graduate school?
This is probably not a good idea.  A strong letter of recommendation will make it clear how the recommender knows the applicant.  If it is apparent that the recommender is a family member, then many readers will simply ignore the recommendation. 

Furthermore, a strong letter of recommendation will describe specific situations in which the applicant did something well.  In this case, your recommender may not know you except through your family connection and probably doesn't know enough about your academic or research background to provide such examples.