It is common for psychology departments to have a cognitive specialization available at the graduate level. At the undergrad level, I would expect to be forced to choose between psychology, neuroscience, linguistics, or something else. That is, cognitive science does not include philosophy or computer science by most academic systems for demarcating scientific domains. In scientific reality, all these domains bleed into one another of course, but you can probably expect to have to choose among them for any degree program. One can often pursue interdisciplinary study to some extent too (e.g., double-major, minor, or have two graduate advisors).
It is not unheard of to approach any degree from any other degree / background as far as I'm aware. Of course it's less likely for a creative writing major to apply for an organic chemistry doctoral program as compared to a biology major, but that's not to say either option is impossible. I don't think it would be exceptionally difficult to transition into a cognitive science from a philosophy background, and I imagine it would be easier still to transition from linguistics to psychology or neuroscience, but it's probably the easiest to stick with a single degree program the whole way. Easiest is not necessarily best, of course.
Consider how competitive you can be for each program, and compare with how badly you want to pursue each and what the world needs most from you. Consider what career options are for each, and which suits you best. Travel into the future and ask your future self what choices you regret...No other method is foolproof, unfortunately. Fortunately, career change is always an option, if not always easy.