I've been asked for undergraduate transcripts when applying for tenure-track professor jobs at universities in the US and Canada. It's not very common. Out of probably 60 applications, I've been asked for such a transcript four times. So probably <10% of my applications, although it might be more common for teaching-focused jobs than research-focused jobs (I've applied to about equal number of both). Three of the times I was asked for it was for predominantly undergraduate institutions, which might make sense. I don't know why they ask for it, but presumably the search committee will consider it. But how much consideration it might be given will probably depend on the attitude of each particular committee member.
Being asked for graduate transcripts is much more common, although I'm still unsure how much they are considered in deciding on whether to offer you the job.
If you do apply to an academic job that asks for an undergraduate transcript, you could probably make it into a positive: you could say something in your teaching statement (or diversity statement) about your struggles in succeeding in your undergraduate academic work and how you could use that experience to help struggling students.
I would like to mention here that, in my experience, the people who did best in classwork do not necessarily turn out to be the best researchers and many successful researchers were not the stars of their classes. In classwork, there is essentially only one path to success, while there are many different paths to success in research. Some succeed in research by having marvelous people skills, building networks of excellent collaborators and efficient research teams. Others succeed by single-mindedly obsessing over important technical problems and solving them. Others get really good at understanding the dynamics of funding agencies and how funding is distributed (nearly all successful independent researchers need some savvy with funding). So don't let some poor grades make you think you can't succeed at research. Best of luck!