I'm 25 years old and I have blood in my stool for the last 3-4 months, for the last month I had constipation and abdominal pain, can it be cancer?

Unlikely need tests. Cancer of colon is rare at 25 , but age is no exception , your symptoms warrants serious investigation, it could be a simple problem see your doctor after examination will order tests including colonoscopy , will treat you depending on findings, do not delay .