1. Don't know anything about the HD foam. I have only used DAP latex foam around vinyl windows. I would rather err on the side of caution.
2. Yes, you can run the jamb right up to the window. but what I've found to work best is to do both- a jamb and a quarter round (actually, I use base shoe, which is 3/4 wide, but only 1/2" thick. I'll make the jamb, nail it all together (with a stool, if needed) and then center that on the window, make it flush with the surface of the wall, shim it in place, and nail it to the r.o. Then if there is a gap between the jamb and the window, the baseshoe covers that. It's very hand to do it this way so as to avoid tapering your jamb if the wall thickness is goofy. Often, it'll be 1 1/4 on one corner, 1 1/8 on the other, 1 3/8 on another, and so on. Making the jamb one width and lining it up with the surface of the wall makes your casing miters work out a LOT better. And I think it looks good too when you have the baseshoe trimming the edge of the window.
See an example at:
http://pg.photos.yahoo.com/ph/thexsleep ... d37re2.jpg
One other thing I'll suggest. Prepaint all your stuff (or stain and varnish) but be sure to do the side of the wood that touches the window as well. I've found that if you don't, vinyl windows can sweat under certain conditions, and if the wood that touches the vinyl is not painted or varnished, mold can begin to grow into the wood. Painting/varnishing that side of the wood may not stop the mold from growing, but it will help prevent the mold from eating into the wood and showing up under your finish.