Are there neural networks that accept graphs or trees as inputs?
Yes, there are numerous, coming under the umbrella term Graph Neural Networks (GNN).

The most common input structures accepted by these techniques are the adjacency matrix of the graph (optionally accompanied by its node feature matrix and/or edge feature matrix, if the graph has such information).

A Comprehensive Survey on Graph Neural Networks, Wu et al (2019) divides GNN's into four subgroups:


Recurrent graph neural networks (RecGNN)
Convolutional graph neural networks (ConvGNN)
Graph autoencoders (GAE)
Spatial-temporal graph neural networks (STGNN)


ConvGNN's can themselves be classified by whether they use Spectral methods or Spatial methods, and GAE's by whether they are designed for Network embedding or Graph generation.