Before colonostomy bag was put on me, barium enema test was 2 painful. After it was put on, dr. Said "be won't hurt now" because of operation. True?

Probably. Since the barium enema tip can now be inserted into the colostomy, rather than the anus, it may be more comfortable.
Possibly. I am not aware what type of problem you had that required colostomy in the first place, so it is hard for me to comment on as to why your be was painful before. The only way to know if he is right is to have it done again. Again, i don't know why you had the procedure done, but to me colonoscopy sounds a better option.