You can, but most don’t gun for GI/Cards. You’ll magically see a bunch of guys who thought Ortho and girls thinking various thinks like Ophtho/Derm, etc. switch to IM at the end of third year which makes up probably a third of the allopathic pool. No one is really gung-ho about IM in M1-2.
Overall if you want to do either of these (Cards/GI) I strongly recommend you still gun like your friends and I didn’t realize this and wish I could go back so I could at least be in the top 40%. When applying to residencies I noticed the fellowship match list to Cards and GI were substantially better at top places for no good reason. I’m not saying mid tier applicants don’t match at top programs because they do but the difference in research effort is substantial. On one hand, the top tier resident can get away with doing one abstract and match MD Anderson for Heme-Onc whereas a mid tier needs a better application overall (research, letters mainly...test scores don’t count except your step 1/CK which are used as cut offs and I don’t believe they’re that high). Also maybe I’m repeating myself from other threads more than I should, but academic IM (code for programs PDs respect when it comes to fellowships) are competitive. People who match top 20-30 in IM would have easily had the grades and scores to match RDS (rad-onc, derm, surgical subspecialties). I would say matching a solid mid tier (Cedars, OSU, Indiana, Jefferson, etc.) is just as difficult if not more difficult than matching into a good gen surg, em, or radiology program.
Oh yeah, in terms of research for GI/Cards being your original question, every bit helps come fellowship time but as the first step is getting IM residency, the research topic is less substantial but keep in mind that quality research is literally a pre-req for most top 20ish places for IM.