Yes you can but it can be a bit tricky to get it to color well. I like using gel-based coloring instead of liquid. Liquid food coloring can change the consistency.  If you are having trouble getting the desired color, you can take a small amount and color it with a couple drops of food coloring. Then microwave it for 5-10 seconds. And then stir that into the rest of the buttercream.