The answer is yes, Animate object would work on a corpse. The exact effect would depend on the size of the corpse.
While there are specific defined terms in D&D 5e there are also a equal number of that rely on what the word means in English.
Object - a material thing that can be seen and touched.
Creature - an animal or person.
However there is a caveat. In various effects, powers, and abilities. The D&D 5e rules are consistent in referring to creatures as things that are living or animate. Objects as inanimate things like tables, chairs, rocks, books, feathers, etc. It not spelled out but it is consistent.
The things to remember is that D&D 5e rules are not to function as a wargame. They do not define the boundaries of what is possible during a campaign. The setting is what defines that. Instead they are a tool to aid the referee in adjudicating the action. For example the description of humans don't spell out every detail that could come up. The mechanics about humans are those that the authors feel that are useful or come up often. The important of which is the effect being human on character creation. The author expect referee to use what they know about humans to adjudicate anything that the rules don't cover because it is implied that humans in a D&D setting are just like people in real life only living in that world.
One implication of this is that animate objects doesn't change any other physical property of the object other than to animate with the stats provided. If you were to say animate a block of salt, possible considering what salt miners carved out of their mines, and it was to walk into water, then it is reasonable to rule that it would be affected adversely as salt dissolves in water. Perhaps by treating water as a acid attack on the animated object.
So a corpse animated as a object would still be a corpse and subject to decay, smelling bad, etc. It would not gain the benefits of being undead although at first glance it would be hard pressed for a character to tell the difference. One area where I can see the difference being important is trying to animate a skeleton. It is reasonable to assume that the various create undead spells joins the bones together to form a complete animated skeleton. While a long dead skeleton is merely a pile of separate objects of bone.
For stuff that has no real world analogue, elves, magic, etc. The authors expect the referee to fall back on their knowledge of the fantasy genre. Because the implied assumption that D&D is being used to depict a fantasy setting. Which is why they included a list of inspirational works in Appendix E on page 312.
In fantasy it is tradition for some spells to work on anything, a lightning bolt doesn't care if its target is a person, animal, or a piece of furniture. Some spells to only work on people, for example charming or enchanting a princess. And other spells to work only on objects, like the animated furniture from Fantasia.
RAW - No, Otto's Irresistible Dance is not a Charm spell
It does not say that the target will be "charmed", and the condition it imposes is significantly different than the description of the "Charmed" condition.
OID:
A dancing creature must use all its movement to dance without leaving its space and has disadvantage on Dexterity saving throws and attack rolls. While the target is affected by this spell, other creatures have advantage on attack rolls against it.
Charmed:
A charmed creature can't attack the charmer or target the charmer with harmful abilities or magical effects. The charmer has advantage on any ability check to interact socially with the creature.
A dancing creature can attack the caster (with disadvantage -- and that disadvantage applies to any attack, not just against the caster) and can cast AoE spells that include the caster and anyone else they choose in the target area with no penalty. They just can't move freely. A charmed character can move freely but can't attack or target the caster.
Furthermore, if it were a Charm spell, it would not be necessary to specify that "[c]reatures that can't be charmed are immune to this spell." That appears to be listed as a special exception.
RAI - No, Otto's Irresistible Dance does not impose the Charmed condition
Jeremy Crawford has tweeted saying:
Being charmed means being subjected to the charmed condition
Since OID does not impose the Charmed condition, the Fey Ancestry resistance to "being charmed" does not apply.
What makes sense?
Webster's dictionary says:
charm: to affect by or as if by magic : compel
Magically forcing someone to dance seems to fall completely within that definition.
I would give those with Fey Ancestry advantage on saves against all enchantment spells that compel the user to do something that is not their own free choice. This includes many spells that do not specifically say they are "charms" or that they impose the "Charmed" condition, such as command, compelled duel, and yes, Otto's irresistible dance. I believe those all fall within the common sense and dictionary definitions of "charmed" in this context, and there's nothing in the description of Fey Ancestry that says it only applies to things that grant the "Charmed" condition.
Best Answer
Whereas nothing is yet explicitly well defined for creature and object I believe the intent at this time is:
No. Nothing is considered an object and a creature simultaneously.
As defined by various Tweets from Crawford:
I assume your question is stemming from a question on targeting. Xanathar's guide has some of the clarifications indicated from the Jan 19, 2017 Podcast which concerns itself with Twin Spell and targeting, it is well worth the listen and might help you out with your game.
In the end if your DM rules that there can be something that fits both definitions regardless if I would personally disagree it is your table. You can argue it but ultimately the decision is theirs.
Clarification on the English portion of my argument in bullet 4: This was an attempt to take the wording from the spell "a creature that has died" and link it to a word that has game connotations "corpse" this is to make a transitive argument as follows:
Therefore
Something with a creature type in its stat block per JC is a creature but objects don't have creature types therefore something cannot be both a creature and an object at the same time.
I think of this as a state. A spell, as an example, can change your state to that of an object for its duration or grant objects a creature state for its duration but once the duration expires your state reverts to its norm.
Another example...
Animate Dead grants a corpse (object) a creature type, it doesn't change an existing creature type from one thing to another.