I mean sometimes they can. However, for example, most engineers at my school (outside of biomedical & chemical engineering) are required to take 1 semester of accelerated engineering chemistry (it kind of smushes concepts from the two semesters of general chem while adding new topics like solid state chemistry) instead of the 2 semesters of gen chem. I had to take that my first semester (although I also took a second semester of gen chem because I ended up becoming chemical engineering and they want that).
And my biology credit that I took at community college doesn't count for anything because I have to take "engineering biology" (of which, like thermodynamics, all the different engineers take different versions), which is a lot harder and covers topics like metabolic engineering, bioreactors, and other things general biology wouldn't cover.
Also, for example, math majors at my university take different math credits from everyone else. There's a version of calculus for science majors, calculus for business majors, calculus for engineering majors, and calculus for math majors (which heavily focuses on proofs). Once you get past, say, calculus II (I think), they won't let you transfer into the math department with math credit unless you've taken that math department's version of their course because it's tailored to the major.
So, general education transfer credit only goes so far in some cases.
But yeah, it can be used for multiple degrees sometimes, but sometimes not. Like the money I wasted on biology. Lol.
Like Monkey said, you need to talk with a counselor and look at a degree plan because there's the possibility of courses you take not transferring for anything at all if you don't plan carefully.