The short answer is that yes, this kind of arrangement would be legal if handled properly.
Permissible Scope of Business
A lawyer is not strictly limited to providing legal advice.
Counselor Rule 2.1 Advisor
In representing a client, a lawyer shall exercise independent
professional judgment and render candid advice. In rendering advice, a
lawyer may refer not only to law but to other considerations such as
moral, economic, social and political factors, that may be relevant to
the client's situation.
The official comment to this Rule is also informative:
Scope of Advice
1 A client is entitled to straightforward advice expressing the
lawyer's honest assessment. Legal advice often involves unpleasant
facts and alternatives that a client may be disinclined to confront.
In presenting advice, a lawyer endeavors to sustain the client's
morale and may put advice in as acceptable a form as honesty permits.
However, a lawyer should not be deterred from giving candid advice by
the prospect that the advice will be unpalatable to the client.
2 Advice couched in narrow legal terms may be of little value to a
client, especially where practical considerations, such as cost or
effects on other people, are predominant. Purely technical legal
advice, therefore, can sometimes be inadequate. It is proper for a
lawyer to refer to relevant moral and ethical considerations in giving
advice. Although a lawyer is not a moral advisor as such, moral and
ethical considerations impinge upon most legal questions and may
decisively influence how the law will be applied.
3 A client may expressly or impliedly ask the lawyer for purely
technical advice. When such a request is made by a client experienced
in legal matters, the lawyer may accept it at face value. When such a
request is made by a client inexperienced in legal matters, however,
the lawyer's responsibility as advisor may include indicating that
more may be involved than strictly legal considerations.
 Matters that go beyond strictly legal questions may also be in the
domain of another profession. Family matters can involve problems
within the professional competence of psychiatry, clinical psychology
or social work; business matters can involve problems within the
competence of the accounting profession or of financial specialists.
Where consultation with a professional in another field is itself
something a competent lawyer would recommend, the lawyer should make
such a recommendation. At the same time, a lawyer's advice at its best
often consists of recommending a course of action in the face of
conflicting recommendations of experts.
 In general, a lawyer is not expected to give advice until asked by
the client. However, when a lawyer knows that a client proposes a
course of action that is likely to result in substantial adverse legal
consequences to the client, the lawyer's duty to the client under Rule
1.4 may require that the lawyer offer advice if the client's course of action is related to the representation. Similarly, when a matter is
likely to involve litigation, it may be necessary under Rule 1.4 to
inform the client of forms of dispute resolution that might constitute
reasonable alternatives to litigation. A lawyer ordinarily has no duty
to initiate investigation of a client's affairs or to give advice that
the client has indicated is unwanted, but a lawyer may initiate advice
to a client when doing so appears to be in the client's interest.
More generally, law firms can indeed provide non-legal services to their clients, even if they aren't providing legal services to that particular client.
For example, in New York State, lawyers are ex officio licensed real estate agents for any client (to oversimplify).
Law firms in every state routinely provide notary public services for clients and non-clients.
Many law firms provide escrow services in transactions where not everyone involved is a client of the firm.
And, lawyer have been known to serve as fiduciaries (e.g. executors and trustees) which can involve a wide array of activities, and not infrequently manage real estate for their clients. With suitable qualifications they can provide accounting and securities services.
One law firm that I worked at also operated a miniature golf course and a drive by expresso stand as separate profit centers within the firm.
The biggest difficulty would be confidentiality. For example, accounting and HR matters can involve a greater obligation to disclose information to third parties than attorneys are allowed to permit for legal clients.
The ethical limitations on a lawyer's financial involvements with a client are also more strict than in most other professions which could present a problem when financial guarantees and the advancement of funds are common business practices in some other kinds of businesses.
The more common way that these questions present themselves is when a non-legal company starts hiring lawyers.
For example, most large accounting firms have lawyers specializing in tax law, securities law, business transactions and tax litigation on staff, and at some point, these in house lawyers are providing services to clients rather than to the accounting firm itself's internal legal needs, so most large accounting firms are firms who have practices that include the practice of law.
Similarly, most title companies have lawyers in house who to some extent represent the title company because the title company is insuring its own title opinions, but often these lawyers end up guiding the actions of the title company's clients based upon these lawyers' legal opinions.
In general, it is more common for a non-lawyer to back into becoming a law firm than for a law firm to intentionally expand into a non-legal line of business.
Practically speaking, it would probably make more sense to set up sister companies that refer clients to each other and operate out of the same location than to operate a single business.
Lawyers may not share profits from a law firm with or be managed in a law firm by non-lawyers (except sharing profits as part of a "profit sharing plan" including non-lawyer employees, with the estate of a deceased lawyer, or with a non-profit referral service).
The type of entity doesn't matter much, although many states require law firms that operate in limited liability entities to have professional malpractice insurance, while not requiring that of law firms with unlimited liability entity types (unincorporated sole practitioners and general partnerships). If professional malpractice insurance must be obtained, a broader practice incorporating non-legal fields would probably increase the price of the professional malpractice insurance premium unnecessarily.
Rule 5.4 Professional Independence Of A Lawyer
(a) A lawyer or law firm shall not share legal fees with a nonlawyer,
(1) an agreement by a lawyer with the lawyer's firm, partner, or
associate may provide for the payment of money, over a reasonable
period of time after the lawyer's death, to the lawyer's estate or to
one or more specified persons;
(2) a lawyer who purchases the practice of a deceased, disabled, or
disappeared lawyer may, pursuant to the provisions of Rule 1.17, pay
to the estate or other representative of that lawyer the agreed-upon
(3) a lawyer or law firm may include nonlawyer employees in a
compensation or retirement plan, even though the plan is based in
whole or in part on a profit-sharing arrangement; and
(4) a lawyer may share court-awarded legal fees with a nonprofit
organization that employed, retained or recommended employment of the
lawyer in the matter.
(b) A lawyer shall not form a partnership with a nonlawyer if any of
the activities of the partnership consist of the practice of law.
(c) A lawyer shall not permit a person who recommends, employs, or
pays the lawyer to render legal services for another to direct or
regulate the lawyer's professional judgment in rendering such legal
(d) A lawyer shall not practice with or in the form of a professional
corporation or association authorized to practice law for a profit,
(1) a nonlawyer owns any interest therein, except that a fiduciary
representative of the estate of a lawyer may hold the stock or
interest of the lawyer for a reasonable time during administration;
(2) a nonlawyer is a corporate director or officer thereof or occupies
the position of similar responsibility in any form of association
other than a corporation ; or
(3) a nonlawyer has the right to direct or control the professional
judgment of a lawyer.
What About California?
While California has somewhat different rules of professional conduct (as do a handful of other states), I don't believe that the differences would be material in this context.
The limitations of Model Rule 5.4 are found primarily in California Rule 1-310 and 1-320.
California has no direct equivalent to Model Rule 2.1, so it doesn't expressly prohibit or allow non-legal activity.
This said, California's legal and business culture is quite receptive to alternative business models and is not particularly hidebound by tradition.
UPDATE: California is expected to adopt a version of the Model Rules of Professional Conduct imminently (probably in 2017 or early 2018), in which case the citations to rules above will be directly applicable.