“Can anyone be locked up for ordering a few books in another person’s name??”

It entirely depends on many facts and circumstances - did the “anyone” who ordered the books pay for them? Or did they cause someone else to incur a bill for the cost of the books? Or were they attempting to defraud a merchant or service, such as signing up for a “book of the month” club in someone else’s name?

In short, any time someone attempts to either avoid paying for something by incurring the charge in someone else’s name, it is most likely an act of fraud, and illegal.