A dramatic foil is a character whose traits are the complete opposite of another character's traits. One reason why Mercutio can be considered Romeo's foil is because Romeo takes love very, very seriously while Mercutio does not. Instead, Mercutio sees love in relation to sexual exploits.
We especially see this stark contrast in Romeo's and Mercutio's views on love in the scene in which Mercutio and Benvolio try to persuade Romeo to crash the Capulet's ball with them. Here we see Mercutio treat love very lightly when Romeo protests that he can't dance at the ball for he feels too heavily burdened by love. One of Mercutio's responses is to say, "If love be rough with you, be rough with love. / Prick love for pricking, and you beat love down" (I.iv.28-29). One thing Mercutio is telling Romeo in these lines is to forget about his broken heart. But these lines can also be interpreted as sexual innuendos. One can be "rough" with love during a sexual act and even the term "prick" can be interpreted sexually. Therefore, Mercutio is telling Romeo to get over his being hurt by love through performing a sexual act with someone other than Rosaline. The fact that Mercutio only sees love in terms of sexuality shows that he and Romeo have different views on love. In addition, the fact that Mercutio is taking Romeo's broken heart so lightly further shows that he and Romeo have very different views concerning love.