Here is an answer for HTML output.
You can change the look of the html using a custom css, and it is easy to assign a specific class for the chunk output using class.output chunk options
---
title: Test box output
output:
html_document: default
---
```{css, echo = FALSE}
.bordered {
border: solid;
}
```
```{r, class.output = ".bordered"}
summary(lm(data = mtcars, mtcars[, 1] ~ mtcars[, 2]))
```
I let someone else gives an answer for PDFoutput. 