Either way, I think it's fine to join a company that is downsizing, since presumably the area you got hired is a department that isn't part of the downsizing. Of course there are horror stories of people who got laid off immediately after getting hired, but that's just bad luck. Most of the time there is a budget for you, or the position wouldn't be advertized in the first place. If you end up doing valuable work on a valuable team, you should be safe from any cuts - and you can ask those questions during the interview process.
From my perspective, any job where you get paid to work on something interesting and learn new stuff is worth considering.
My general observation is some companies use layoffs as a periodic way to get rid of folks without performance reviews. (“Position was eliminated” doesn’t lead to law suits) Also, when companies do multiple rounds, they get less generous on each subsequent round.When you are really early in your career then you are less likely to be affected by big company layoffs. You are a relatively small cost and viewed as someone who might hang around, so are worth investing in. At least, you'll get a shot at filling the boots of the people who left until the better times come around.
EDIT: One other thing to look at is how the company cuts. Cutting a little when deep cuts are needed has a big impact on the day-to-day experience. No one feels safe. If there is a CEO who makes big cuts that seem reasonable for the business (completely ignore the tech) then you are better off.
Once you're mid and senior level it's a bit harder to hop out and into a new job on very short notice--you really need clout and the right place at right time, or connections/network of companies that are hiring.
No, it may not be wise because it may result in you actually getting laid off soon after joining or having your offer rescinded 1 hour before start. As a great man once said, it all depends on your risk tolerance.