As with many questions in logic, the answer to this question is "it depends on how you set things up".
Most questions in math don't depend on the precise details of your foundational system, but the closer to logic you get the more you start having to deal with exactly what you're working with under the hood. In particular, for this question, it's important to ask what the fraction symbol $\frac{\cdot}{\cdot}$ is representing${}^1$! The usual setup for model theory doesn't allow partial functions, so we can't say $\frac{\cdot}{\cdot} : \mathbb{Q} \times (\mathbb{Q} \setminus 0) \to \mathbb{Q}$ is undefined when the denominator is $0$. How do we get around this?
The typical trick is to relationalize things. We add a new ternary relation $\text{"}\frac{x}{y} = z\text{"} \subseteq \mathbb{Q}^3$ so that the proposition "$\frac{x}{y} = z$" is given the value "true" exactly when, well... the relevant equation is true, haha.
There are other options too, for instance some authors${}^2$ really want $\frac{\cdot}{\cdot}$ to be a function, so they're willing to define $\frac{x}{y}$ to be $0$ when $y = 0$! Doing this renders $\frac{\cdot}{\cdot}$ a total operation, so that model theory can talk about it, but it's fairly nonstandard.
Yet a third option is to work with a multi-sorted logic, which explicitly has a sort for $\mathbb{Q}$, a separate sort for $\mathbb{Q}^\times = \mathbb{Q} \setminus \{ 0 \}$, and a function symbol $\frac{\cdot}{\cdot} : \mathbb{Q} \times \mathbb{Q}^\times \to \mathbb{Q}$.
Let's take a look at these three options.
In case we have a ternary relation, then the formula "$\frac{1}{0} \in \mathbb{Q}$" is actually an abbreviation! It's shorthand for
$$
\exists z . \left ( \text{"}\frac{1}{0} = z\text{"} \right ) \land \left ( z \in \mathbb{Q} \right )
$$
This is obviously a well formed expression, where the proposition "$\frac{1}{0} = z$" happens to be false for all choices of $z$, so that this formula is false!
In case we flippantly define $\frac{1}{0} = 0$, then, of course, we have no issues at all (but again, most authors go for the ternary relation approach).
Lastly, in case we work with a multisorted logic, $\frac{1}{0}$ is not a well formed formula (since proper sorting is baked into the definition of a "term" in the logic). So the entire formula $\frac{1}{0} \in \mathbb{Q}$ is itself not well formed.
Obviously when we work with fractions in our day to day life, the precise formalization of $\frac{\cdot}{\cdot} = \cdot$ as a ternary relation symbol, or something given a weird "default value" of $0$, etc. doesn't matter at all. But when you start asking questions like "is this a well formed formula" the answer sort of has to depend on the specifics of however you choose to formalize such things.
I hope this helps ^_^
${}^1$: As a cute aside, I'm pretty sure this is where the division symbol $\div$ comes from! It's a fraction with two $\cdot$s as placeholders for the arguments!
${}^2$: See, for example, chapter 1 exercise 7 in Hodge's A Shorter Model Theory