It all depends on the State laws where the museum is located, and on what state of " Legal " being the museum is. If its a propretorship- individually own, or a partnership, " donating " anything to the " Museum " is simply a gift, and becomes the private property of the owner(s). If its a Corporation, the museum may be also a Tax Exempt organization under Section 501(c) of the IRS CODE, or it can simply be a " nonprofit " institution, without tax exempt status. Usually, most states require that any Nonprofit corporation provide that the assets of the corporation, on dissolution or termination, MUST be donated to some similar nonprofit association. With your 501(c) application, the Tax Code requires that the taxpayer designate some alternate qualified " charitable, etc" institution or group to receive the assets.
If you seek to make a gift of any property to a museum, you need to find out if they have a tax exempt status( so that you qualify to deduct the value of the gift from your own estate!) If they don't you may still want to "Loan" the gun to the museum or collection for public Display.
I have a friend who has Loaned a few guns to the National Firearms Museum in Fairfax, Va., run by the NRA. I don't think he wants to give those guns to that museum, but that could change. In many museums, there will be signs indicating that a particular exhibit piece is " donated " by so-and-so, or is on LOAN from another museum or private collector. That is the reason for those signs. A good museum curator wants to protect his collection from any claims that he is stealing an item from someone, and by putting up signs with the exhibit, he alerts his successors as to which items the Museum owns outright, and which it does not own. That then steers his successor to go to the bookwork maintained by the curator during his term in office.
Curators who take that kind of care of donated, and loaned pieces are more likely to see such items "GIFTED" to the museum when the owners die, and many collectors are great supporters of public and private museums. They like the idea of their collection being shown to the public, without the expense and headaches of providing the security and access to their collection in their own homes, or storage areas.
The museum would be legally able to auction off the guns that it owns, but not the guns on loan to the museum, without the owner's specific authorization. The money may be then transferred to the Charitable, educational, etc. entity listed in its bylaws, and filed with the State or with IRS.
My BP club has in its by-laws a provision that upon dissolution and payment of all legal debts, its money will be donated to the NMLRA. Another club provides that its assets will go to the NRA.