Is it legal to get a house using my income and someone else's income even though my name is going to be on the mortgage and their name will not be on the mortgage?
The only income that lenders will consider for a full doc loan is the income of the applicant. If only you are going to be on the mortgage, the lender will only ask for proof of your income. If your provable income is sufficient to qualify, then it doesn't matter how you and the other person allocate your respective incomes and pay the bills.
On the other hand, if you are applying for a "stated income" loan and you list your combined incomes as being your own on the application, this is fraud. If for example you make $30,000 and you need to make $50,000 to qualify for the loan, by saying that the "other person's" income is your own, you've misrepresented your income to qualify and that is fraudulent.
It's also dangerous. Let's say this other person is your fiancee and after you get the loan and buy the house, the two of you break up and your fiancee leaves. You probably won't be able to afford the mortgage payment and the mortgage will probably go into foreclosure. The lender will probably audit your application and find out about the fraud, leaving you open to criminal charges. You will have a foreclosure on your credit report as well and it will be awfully difficult to buy a house again for a while.
In short, stay away from doing it.