From a practical perspective, there is no such thing as international "law"
The purpose of law (in an idealistic sense) is to guarantee the freedom of the individual while protecting the needs of that individual's society. From the perspective of the tyrant, "society" is reflected in the tyrant's wishes, limiting the freedom of the individual to ensure the tyrant is served. From the perspective of the anarchist, "society" is reflected in the loose association of individuals thereby permitting any individual the greatest freedom possible. "Law" and its enforcement is what creates the balance between my freedom and my service to my society.
So, what's my point?
- "Law" is worthless without a policeman.
- There are no international policemen.
Humanity has tinkered with the idea of a planetary government (e.g., the League of Nations and the United Nations), but as yet there is not a single governing entity that serves as the ultimate authority over the planet empowered to bring police authority to bear against the planet's individuals.
Which means all you have are treaties... and treaties, like rules, are often meant to be broken
Simplifying things a bit, behavioral requirements between the government and the governed are called "laws." But government and the governed (despite the U.S.'s declarations otherwise in the Gettysburg Address) are not equals. Government always has the authority to bring the threat of violence against the governed. (Contrast this with the governed bringing the threat of violence against its government, an act identified in law as rebellion and sedition, and pretty much always deemed illegal despite its celebration in the U.S. Declaration of Independence.)
But today, between nations, things are a great deal more... equal. In other words, while any two nations could be compared (e.g., their economies, military, health and welfare, etc.) to determine whether one was stronger than the other, their sovereignty is always equal. When two nations disagree about sovereignty, the result is war.
How does this all apply to your question?
There are no "laws" governing the excavation of resources on other planets. There are treaties proscribing such activity. And the day a critical resource is found that one nation can gather with reasonable economic loss is the day that treaty will come to an end. In our world today, sovereign national interests always take precedence over the social justice of international cooperation (with the exception of smaller nations that do not enjoy enough military strength to defend such selfish aspirations. Such nations have the luxury of thinking in more holistic terms). No resource would be deemed more critical than actual alien tech.
"Law" is only as valuable as the system that regulates and promotes it. Thus, wealthy people get away with proverbial murder while the poor are crushed by taxes. In the context of your question: large, wealthy nations will fight among themselves for the tech and the treaties be damned. That particular competition would have a good chance of being fought in terms of a cold war between corporations supported by national interests so that the perception of international cooperation could be preserved while the nations fight, nonetheless, for possession of what would likely be deemed the most valuable resource in our current universe.
Speaking further of enforcement, the only countries in question are those with the capacity of space flight. Not just the ability to drop a satellite into orbit, but the ability to at least get to the moon and back. That's a very short list: the U.S., Russia, China, the European Union, India, and possibly Japan, South Korea, and the UAE. And of those, only one has actually put people on the moon. Nevertheless, all other nations are bystanders to the question. None can get to the alien tech and none have the political strength to enforce any treaties.
So, what's the answer to your question?
Actually, questions. Please note for future reference that you're expected to ask one and only one question.
Is excavating alien technology legal? Although I have not given anywhere near the detail necessary to justify what I'm about to say, I believe that a purely legal argument could be made to say that it is illegal to excavate alien technology without first introducing a new treaty governing how that would be done and who would benefit. At least seven nations would howl like banshees if someone found alien tech and tried to excavate it without their blessing.
Are there laws prohibiting the import of non-terrestrial objects to the surface of the Earth? Not that I know of. There is precedent, however, in the form of moon rocks (items of non-terrestrial origin, if we ignore one of the origin theories of the moon) suggesting that such objects could be imported. But, once again, for primarily political reasons, at least seven nations would howl — and I would expect them to use the, "oh, crap, you're going to start the zombie apocalypse!" argument in an effort to win priority over possession.
Nations are greedy, people are selfish, and alien tech is valuable. Conclusion: if it could be said that laws affecting alien tech exist, humans would find every means (legal and illegal) to circumvent them.