Yes you may apply to more than one residency, and when considering some specialties it may help to have a back-up you think you'd also enjoy as a career. IM is the most common because most of the competitive fields require a prelim year in IM or surgery (or transitional) anyhow, so the first year would be the same anyhow. However you aren't going to have unlimited time to interview, and in the more competitive paths you may be trying to do 20+ interviews plus separate interviews for prelim programs, so in most cases it's going to be unrealistic to put enough of an effort toward multiple paths on top of that. The interview process is a poor way to try and decide on a specialty, so if you aren't sold on a particular field by the beginning of fourth year, many med school advisors would advise you to strongly consider spending a research year and delay graduation/ do more electives until you have a better notion. Also, if you are applying to a competitive field that requires a preliminary year in medicine or surgery, you will already be interviewing for those prelim spots, so that, in and of itself will be a one year "back-up" -- You can rank those separately at the end of your rank list so you can end up in one even if you "advanced" specialty choice doesn't pan out.
At the end of the road, you are going to have to submit a rank list based on your desires, so some specialty is going to have to be your first choice, and you are going to have to target your efforts toward a realistic number of programs, while trying to survive away rotations, sub-internships and other fourth year obligations. So really plan on having a single target when you emerge from your core rotations. You can have a back-up plan, but it's a bad idea to have two primary targets.
Yes there are combined residencies, such as IM/Peds, EM/IM. But those spots tend to be pretty limited, so for many people bound for IM, EM, Peds, etc those tend to be the long-shots.