Yes sometimes bladder cancer can be mistaken for a UTI.
Bladder cancer as well as UTI or urinary tract infections cause hematuria, and bacteriuria which also occurs in about 50% of patients with squamous cell carcinoma.
So it's a good idea to have a good through test done and more than one test done to be sure whether it's bladder cancer or just a UTI.
A UTI is less serious than bladder cancer so you don't want to have just one test done and it be determined it's a UTI when it's actually bladder cancer.
When a person has bladder cancer they usually will have blood in the urine but blood in the urine doesn't always mean you have bladder cancer.
So the doctor should do several tests to determine for sure if it's a UTI or bladder cancer.