Definitely, yes you can, in my view. But with conditions, of course.
I think quite a few illegal drugs have a less pernicious impact than alcohol.
And yet I know numerous people who drink alcohol and are also good parents. My ex-husband is an excellent parent and still drinks moderately, including when she is with him. (I don't. But even if I did, I don't think it would make me a shit mom).
As it happens I also don't use illegal drugs and don't believe he does either.
But, if I felt the need for anything like that at this point in my life, I think I would choose cannabis over booze.
I wouldn't use either in the presence of my daughter while she is still a minor.
But I don't think people who drink moderately in front of their kids are sinners. Or who smoke a very moderate degree of weed.
Both could be ruinous, of course, taken to excess.
It's all about when, where, why, how much, andthe impact it has on you, in my opinion.
(Of course I know that excessive drug use in a parent, including excessive alcohol use, can ruin children's lives - I don't mean to advocate for it in any way, and I hope that is clear!)