You are asking two separate questions here. First, is it ethical to be proud of one's country? And second, can you be proud of something that you did not create?
The first, as others have mentioned, is dependent on what you use to define your ethics. In most ethical systems, to have pride (which is different from being possessed by hubris) is amoral. If a country is doing something which is ethical, then it is good to be pleased in that country. If a country is doing something unethical, then it is good to be ashamed of it. Most of the time a country, because it is made up of people, is like a person, and is in a much more complicated situation than merely being one or the other.
The second is an entirely different question. You can be proud of things you do not create, but are a part of. I like being a part of my family, and am proud of them for their accomplishments. I may have influenced the way my family is, but I did not create my family. I was merely given the opportunity to be part of it. The same for a club, or a college, or a community. A country is just much larger, and you are a much smaller part of it. But you can still be proud of this collective identity if you so choose, and the ethics of that seem mostly irrelevant to most ethical systems.
In general, however, I do not believe that most people who are proud of their country are applying the kinds of critical analysis that they would of other things. Because a country is such an abstract notion, and a person's idea of something can stray so far from the actual reality of it, I think many people end up with a harmful, blind, and unconditional approval of one's country despite all evidence to the contrary. Like recurring domestic violence between a husband and wife, where one or the other is unable to admit the fault or wrongdoing of the other. People tend to think it is wrong to apply value judgments to something they love, but that kind of detached, uncritical sense of loyalty actually turns out to do more harm than good.