Excluding "ridiculously unacceptable conditions", it is legal to have "non-uniform" contract terms (where a company treats different classes of individuals differently), provided that the basis for distinction is not statutorily prohibited (race, religion, age, sex... depending on jurisdiction). There is a extremely slim chance that apparently legal income-discrimination can be a proxy for another form of illegal discrimination. However, "ridiculously unacceptable conditions" are unlikely to be found to be enforceable, regardless of any demographic properties associated with the condition. E.g. a clause requiring the surrender of a first-born female child would be unenforceable as "unconscionable".
The specific circumstances surrounding such a finding by the court can't easily be summarized, since it relies heavily on prior case law, statutes, and legislative declarations. The underlying premise behind using the doctrine of unconsionability in such a case is that the clause in question is not something that a reasonable person would agree to, but they have no power to disagree. In the US, the case Williams v. Walker-Thomas Furniture is the leading case on this view. The clause in question was about a payment plan for furniture and the condition that no furniture could be paid off until all of it was. The consequence of the clause was that all of the furniture could be repossessed if any payment was missed, regardless of how much had already been paid. Various factors went into the court's ruling (that the condition was unenforceable), such as "absence of meaningful choice", "terms which are unreasonably favorable to the other party", :gross inequality of bargaining power".
In the circumstance that you allude to, it is not obvious that the courts would follow Williams in making their ruling – it would depend on the extent to which one could reasonable conclude that the customer understood and freely accepted the term. There are upper limits on what a court can enforce, so a contract requiring a party to commit suicide would be utterly unenforceable (in most countries), and a contract requiring a party to break the law would be likewise.