The short answer is: yes. Many authors have published fiction for different age groups. Notable authors who've done this very successfully include James Patterson (adult and young adult), J.K. Rowling (middle grade, young adult, and adult), and Suzanne Collins (middle grade and young adult).
The long answer is a little more complicated. The best advice I heard from an agent in response to the question was this: start out by focusing on one age group. That is, if you're querying a young adult novel, it's probably best not to mention the picture book, middle grade novel, and adult novel that you are have in progress. The agent is better able to sell multiple books to publishers if the audience is cohesive.
Another factor to consider is that most literary agents tend to specialize in one or two age groups. An agent who is interested in middle grade novels may not be willing to also represent your adult novel, since they may not have the publishing contacts to sell it. So multiple agents might be required if you want to go the multiple-age-group route.
That's not to say that you can't eventually branch out into other age groups after you've made some sales in your first age category. Some authors choose to do this by using a pen name (this causes less confusion for their middle grade fans if they write an adult novel full of sex and violence).
Of course, the advice above may not be true for everyone. I know a lovely gal whose agent sold her first book, a middle grade novel, and then turned right around and sold a picture book she'd written. So as always, there are exceptions to every rule.
Are you interested in writing for more than one age group?