Schools can have articulation agreements with local CCs. I believe it’s very common in California. I haven’t heard or read anything about similar arrangements with 4 year schools.
Also if you’re considering transferring during your freshman year, your HS stats need to be excellent because schools will evaluate them since you’ll provide very limited college stats at that point.