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.
As written, the witch archetype beast-bonded's supernatural ability twin souls kills a possessed foe
The spell magic jar has a series of clauses making missteps extremely dangerous, both for the possessor and the possessed, but the beast-bonded witch's supernatural ability twin souls changes that effect with three parenthetical words. It says that
...if the witch or her familiar is gravely injured or about to die, the soul of the dying one immediately transfers to the other’s body. The two souls share the surviving body peaceably, can communicate freely, and both retain their ability to think and reason. The host may allow the guest soul to take over the body temporarily or reclaim it as a move action. They can persist in this state indefinitely, or the guest can return to its own body (if available) by touch, transfer into a suitable vessel (such as a clone), or take over another body as if using magic jar (with no receptacle).
Emphasis mine. First, for the ability to activate, the GM must determine that either the witch or the familiar is either gravely injured or about to die (which means, I assume, the creature has the condition dying but ask the GM).1
Assuming the witch activates the special ability twin souls by whittling himself to dying 1 point of damage at a time (the witch doing this to himself rather than to his familiar because the witch needs the familiar to prepare spells), the witch then inhabits the familiar's body as per the description of the ability twin souls and can use an effect like the spell magic jar "with no receptacle."2
What this parenthetical means is deeply unclear. This 2012 thread offers one interpretation. Below I present an alternative that combines the special ability twin souls and the spell magic jar stripped of all references to the receptacle. Such an ability reads...
You can attempt to take control of a nearby body, forcing its soul out of its body, killing it if it has nowhere to go. The spell ends when you send your soul back to your own body.
Attempting to possess a body is a full-round action. It is blocked by protection from evil or a similar ward. You possess the body and force the creature's soul out unless the subject succeeds on a Will save. Failure to take over the host leaves your life force in the current body, and the target automatically succeeds on further saving throws if you attempt to possess its body again.
If you are successful, your life force occupies the host body, and the host's life force is pushed out. You keep your Intelligence, Wisdom, Charisma, level, class, base attack bonus, base save bonuses, alignment, and mental abilities. The body retains its Strength, Dexterity, Constitution, hit points, natural abilities, and automatic abilities. A body with extra limbs does not allow you to make more attacks (or more advantageous two-weapon attacks) than normal. You can't choose to activate the body's extraordinary or supernatural abilities. The creature's spells and spell-like abilities do not stay with the body.
If the host body is slain, you die, and the life force of the host departs (it is dead). Any life force with nowhere to go is treated as slain.
If the spell ends while you are in a host, you return to your body (or die, if it is out of range of your current position).
Alternatively, you can take a move action to touch your body to return your life force to it.
...And while that seems crazy, it's not quite as crazy as it sounds. Yes, this magic jar effect is a save-or-die, but a beast-bound witch must be at least level 10 to use this ability, which means save-or-die effects have been available for at least 3 levels (e.g. phantasmal killer). Further, the witch had to render himself dying first to have access to the ability. Also, once the magic jar effect is used successfully, the only way the witch can use the ability again is by rendering the new body dying again, transferring to the familiar, and finding another body to possess; the ability doesn't appear to work while the witch is possessing a creature, but ask the DM. Finally, the duration of the magic jar effect remains: it's 1 hour/level, and the only longer-lasting switch the witch can make is to his own body or a "suitable vessel," a term the GM must also clearly define.
(Remember, too, that once the witch fails to possess an individual, the witch can never possess that individual. That might be a hassle.)
Officially, however, what the ability should do is mysterious and in the GM's hands. Talk with the GM first before attempting to exploit it. Also, I urge you to press the FAQ button on this post—as I did—to encourage Paizo's development team to address the beast-bound witch's twin souls ability in a future FAQ.
1 This GM would rule that an effect that straight-up, flat-out kills the witch or familiar still leaves the witch ding-dong dead, and the twin souls ability goes unused. Being gravely injured or about to die is a thing, but dead is dead. This GM doesn't view the the special ability twin souls as having a kind of limited omniscience, but another GM may. Such is a risky tack to take, however, possibly making a nigh-unkillable character, one that keeps his familiar in a secure yet comfortable lair miles (or continents or planes) away from any direct engagement, and who uses acquired bodies to depart the lair and harry his foe. This is, essentially, a dirt cheap (and likely murderous) variant of astral projection yet 7 levels early.
2 My gut says that with no receptacle should've said using the witch's or the familiar's body as a receptacle yet space constraints forbade that language. But that is totally speculation on my part and isn't what the ability says.
Best Answer
Container is an object, body is a creature, but ask your DM
The jar is an object, matching the object definition on p. 204 PHB.
The jar itself is not sentinent, it is just housing the soul, and that does not make it a creature:
The body is a creature. In general, a creature is a body with a soul although there can be exceptions (see for example, many inhabitants of Barovia in Curse of Strahd); your soul is still your soul, just out of body.
The body is described as catatonic which means "in an immobile or unresponsive stupor" and alive, and only creatures can be alive. It is not inanimate (i.e. "lacking life"), as an object needs to be. The text "if your body is dead when you return to it...", also demonstrates that the body normally is not dead, thanks Mindwin.)
But this is an unusual setup, and neither the spell nor the rules do explicitly really say as what the body or container does count, so I'd expect the DM will have to decide how to handle this.