Yes, you can! Math figures inside a paragraph will not trigger a new paragraph, unless they are followed by a blank line.
β
Specifically, the following will result in one paragraph containing the figure:
β
foo
```$
e = mc^2
```
bar
The following will result in two paragraphs with a figure between them:
β
foo
```$
e = mc^2
```
bar